JMax Documentation
Built-in functions reference. Every function listed here works in the playground, notebook, CLI, and IDE.
Linear Algebra
A * B Matrix multiply. Use * operator on matrices.
A \ b Solve linear system Ax = b. NxN via LU decomposition.
eig(A) Eigenvalues of a symmetric matrix via QR algorithm.
svd(A) Singular values via eigendecomposition of A'A.
qr(A) QR decomposition via Gram-Schmidt.
cholesky(A) Cholesky decomposition. A must be symmetric positive definite.
inv(A) Matrix inverse via Gauss-Jordan elimination.
det(A) Determinant via LU decomposition.
trace(A) Sum of diagonal elements.
rank(A) Matrix rank via SVD.
A' Matrix transpose. Use postfix apostrophe.
eye(n) Identity matrix.
zeros(m, n) Zero matrix.
ones(m, n) All-ones matrix.
linspace(start, end, n) N evenly spaced values.
Statistics
mean(data) Arithmetic mean.
std(data) Standard deviation (sample).
var(data) Variance (sample).
median(data) Median value.
percentile(data, p) P-th percentile (0-1).
correlation(x, y) Pearson correlation coefficient.
covariance(x, y) Sample covariance.
t_test(a, b) Welch's two-sample t-test. Returns p-value.
chi_squared(observed, expected) Chi-squared test statistic.
linear_regression(x, y) OLS. Returns [intercept, slope, r_squared].
normal_cdf(x) Standard normal CDF.
normal_pdf(x) Standard normal PDF.
Signal Processing
fft(signal) Fast Fourier Transform (Cooley-Tukey). Returns magnitude spectrum.
ifft(spectrum) Inverse FFT.
convolve(a, b) Linear convolution.
fir_filter(signal, coeffs) FIR filter.
spectrogram(signal, win, hop) STFT magnitude spectrogram.
hann(n) Hann window of length n.
hamming(n) Hamming window of length n.
blackman(n) Blackman window of length n.
Machine Learning
relu(x) Rectified linear unit. max(0, x).
sigmoid(x) 1 / (1 + exp(-x)).
tanh_act(x) Hyperbolic tangent activation.
gelu(x) Gaussian error linear unit.
swish(x) x * sigmoid(x).
softmax(logits) Softmax over a vector. Numerically stable.
cross_entropy(pred, target) Cross-entropy loss.
mse_loss(pred, target) Mean squared error loss.
accuracy(pred, target) Classification accuracy.
Symbolic Math
sin(x) Sine.
cos(x) Cosine.
tan(x) Tangent.
asin(x) Arcsine.
acos(x) Arccosine.
exp(x) e^x.
log(x) Natural logarithm.
log2(x) Base-2 logarithm.
log10(x) Base-10 logarithm.
sqrt(x) Square root.
abs(x) Absolute value.
floor(x) Floor.
ceil(x) Ceiling.
round(x) Round to nearest integer.
Finance
black_scholes_call(S, K) Black-Scholes call option price. T=1yr, r=5%, sigma=20%.
black_scholes_put(S, K) Black-Scholes put option price.
sma(data, window) Simple moving average.
ema(data, span) Exponential moving average.
sharpe(returns, risk_free) Sharpe ratio.
max_drawdown(prices) Maximum drawdown.
npv(rate, cash_flows) Net present value.
irr(cash_flows) Internal rate of return.
Bioinformatics
smith_waterman(seq1, seq2) Local alignment score.
needleman_wunsch(seq1, seq2) Global alignment score.
gc_content(seq) GC content ratio (0-1).
reverse_complement(seq) DNA reverse complement.
translate_dna(seq) Translate DNA to protein.
Data Analysis
sort(data) Sort a vector ascending.
unique(data) Remove duplicates.
cumsum(data) Cumulative sum.
diff(data) First differences.
len(data) Length of a vector or array.
Visualization
plot line data Line chart.
plot scatter data Scatter plot.
plot bar data Bar chart.
plot histogram data Histogram with automatic binning.
plot heatmap matrix Heatmap with Viridis colormap.
plot surface matrix 3D surface plot.
plot contour matrix Contour plot with marching squares.
plot boxplot data Box-and-whisker plot.
plot violin data Violin plot with KDE.
plot radar data Radar/spider chart.