Applies a function to each element of a array or matrix.
Asserts that a value is a 1D array.
Asserts that a value is a valid dimension (0 or 1).
Asserts that a value is a 2D matrix.
Asserts that a value is a valid normalization flag (0 or 1).
Asserts that a value is a number.
Retrieves the current date and time as a date vector.
Convert date and time to a serial date number (Unix).
Convert Unix timestamp to string format.
Convert date and time to an array of components.
Applies a function to each element of a array or matrix.
Asserts that a value is a 1D array.
Asserts that a value is a valid dimension (0 or 1).
Asserts that a value is a 2D matrix.
Asserts that a value is a valid normalization flag (0 or 1).
Asserts that a value is a number.
Retrieves the current date and time as a date vector.
Convert date and time to a serial date number (Unix).
Convert Unix timestamp to string format.
Convert date and time to an array of components.
Checks if the input is a 1D array.
Checks if an array or matrix is empty.
Checks if the input is a function.
Checks if the input is an integer.
Checks if the input is a boolean.
True for matrix (2D array with consistent row lengths).
True for null values.
True for number.
Checks if the input is a scalar value.
Checks if a matrix is singular (non-invertible).
Checks if the input is a string.
Checks if the input is undefined.
Checks if the input is a vector.
Extracts the month from a Unix timestamp.
Current date and time as a Unix timestamp.
Generates a random alphanumeric string.
Finds all occurrences of a substring within a string.
Gets the current date as a Unix timestamp.
Applies a function to each vector column or row of a matrix.
Gets the ISO weekday for a given Unix timestamp.
Checks if the input is a 1D array.
Checks if an array or matrix is empty.
Checks if the input is a function.
Checks if the input is an integer.
Checks if the input is a boolean.
True for matrix (2D array with consistent row lengths).
True for null values.
True for number.
Checks if the input is a scalar value.
Checks if a matrix is singular (non-invertible).
Checks if the input is a string.
Checks if the input is undefined.
Checks if the input is a vector.
Extracts the month from a Unix timestamp.
Current date and time as a Unix timestamp.
Generates a random alphanumeric string.
Finds all occurrences of a substring within a string.
Gets the current date as a Unix timestamp.
Applies a function to each vector column or row of a matrix.
Gets the ISO weekday for a given Unix timestamp.
Round toward positive infinity.
Cumulative mean deviation.
Cumulative maximum of array elements.
Cumulative minimum of array elements.
Cumulative product of array elements.
Cumulative sum of array elements.
Differences between adjacent elements.
Computes the dot product of two arrays.
Checks for equality between two values or arrays.
Rounds toward negative infinity.
Greater than or equal comparison X >= Y.
Greater than comparison X > Y.
Round toward positive infinity.
Cumulative mean deviation.
Cumulative maximum of array elements.
Cumulative minimum of array elements.
Cumulative product of array elements.
Cumulative sum of array elements.
Differences between adjacent elements.
Computes the dot product of two arrays.
Checks for equality between two values or arrays.
Rounds toward negative infinity.
Greater than or equal comparison X >= Y.
Greater than comparison X > Y.
Left array division X .\ Y.
Less than or equal comparison X <= Y.
Less than comparison X < Y.
Subtraction X - Y.
Matrix left division X \ Y.
Modulus after division.
Matrix power X ^ Y.
Matrix right division X / Y.
Matrix multiplication.
Not equal comparison X ~= Y.
Element-wise power X .^ Y.
Product of array elements.
Right array division X. / Y.
Remainder after division.
Round to nearest integer.
Sum of array elements.
Element-wise multiplication of arrays, matrices, or numbers.
Unary minus -X.
Unique values in an array or matrix.
Left array division X .\ Y.
Less than or equal comparison X <= Y.
Less than comparison X < Y.
Subtraction X - Y.
Matrix left division X \ Y.
Modulus after division.
Matrix power X ^ Y.
Matrix right division X / Y.
Matrix multiplication.
Not equal comparison X ~= Y.
Element-wise power X .^ Y.
Product of array elements.
Right array division X. / Y.
Remainder after division.
Round to nearest integer.
Sum of array elements.
Element-wise multiplication of arrays, matrices, or numbers.
Unary minus -X.
Unique values in an array or matrix.
Absolute value.
Error function.
Complementary error function.
Inverse complementary error function.
Inverse error function.
Computes the exponential value.
Absolute value.
Error function.
Complementary error function.
Inverse complementary error function.
Inverse error function.
Computes the exponential value.
Computes the natural logarithm (base e).
Computes the sign of a number.
Computes the square root of a number, array, or matrix.
Computes the natural logarithm (base e).
Computes the sign of a number.
Computes the square root of a number, array, or matrix.
Partial row pivoting, with no rank decision and no mutation of the input.
Row equilibration makes the pivot policy invariant to row units/scales. A pivot <= relativeTolerance is numerically singular. This is a pivot test, not an SVD rank or condition-number estimate. Zero tolerance tests exact zeros.
Validate once at the numeric API boundary.
Row-major packing without an intermediate Array.flat allocation.
Center in translated coordinates without rounding the mean back to the origin.
Shifted Welford accumulator: retain small variations around a large origin.
Shape-preserving normal loss estimates with explicit finite-domain checks.
An f64 matrix resident in WASM memory. Storage is column-major:
view()[column * rows + row]. Fill the view directly to avoid a JS-to-WASM
input copy; use multiplyInto to reuse output storage across calculations.
- cols(): number
-
dispose(): void
Release WASM storage. Repeated disposal is harmless.
-
from(a: number[][]): DenseMatrix
Copy nested row-major input once into persistent column-major storage.
-
multiplyInto(): DenseMatrixrhs: DenseMatrix,out: DenseMatrix
Multiply without JS input/output copies, overwriting a distinct output.
- rows(): number
-
setData(): thisdata: Float64Array,layout?: "row-major" | "column-major"
Replace values from a typed buffer without allocating WASM storage.
-
toArray(): number[][]
Copy results out only when needed by the application.
-
view(): Float64Array
Borrow the current memory view; see the class lifetime contract.
Matrix determinant.
Reusable, row-equilibrated LU factorization of a finite square matrix. The default numerical singularity threshold is n * Number.EPSILON on pivots after each row is scaled by its largest absolute entry. It is not a condition number estimate. Pass an explicit nonnegative relative tolerance to override. Inputs and factorization state are never exposed or mutated by solve().
Factor once and solve several right-hand sides without repeating elimination.
An f64 matrix resident in WASM memory. Storage is column-major:
view()[column * rows + row]. Fill the view directly to avoid a JS-to-WASM
input copy; use multiplyInto to reuse output storage across calculations.
- cols(): number
-
dispose(): void
Release WASM storage. Repeated disposal is harmless.
-
from(a: number[][]): DenseMatrix
Copy nested row-major input once into persistent column-major storage.
-
multiplyInto(): DenseMatrixrhs: DenseMatrix,out: DenseMatrix
Multiply without JS input/output copies, overwriting a distinct output.
- rows(): number
-
setData(): thisdata: Float64Array,layout?: "row-major" | "column-major"
Replace values from a typed buffer without allocating WASM storage.
-
toArray(): number[][]
Copy results out only when needed by the application.
-
view(): Float64Array
Borrow the current memory view; see the class lifetime contract.
Reusable, row-equilibrated LU factorization of a finite square matrix. The default numerical singularity threshold is n * Number.EPSILON on pivots after each row is scaled by its largest absolute entry. It is not a condition number estimate. Pass an explicit nonnegative relative tolerance to override. Inputs and factorization state are never exposed or mutated by solve().
Matrix determinant.
Factor once and solve several right-hand sides without repeating elimination.
Computes the inverse of a square matrix.
Solve a linear system of equations Ax = b.
LU decomposition with partial pivoting.
Multiply nonempty numeric matrices. The JS backend avoids packing for small
products; the WASM backend borrows packed inputs. Inputs are not modified.
backend is an override, not a promise of a universal performance crossover.
Select a backend explicitly for reproducible measurements or automatically.
Computes the inverse of a square matrix.
Solve a linear system of equations Ax = b.
LU decomposition with partial pivoting.
Multiply nonempty numeric matrices. The JS backend avoids packing for small
products; the WASM backend borrows packed inputs. Inputs are not modified.
backend is an override, not a promise of a universal performance crossover.
Select a backend explicitly for reproducible measurements or automatically.
Concatenates arrays and matrices along the specified dimension.
Create a clone of the input array or matrix.
Generates an array of numbers from start to end with a specified step.
Diagonal matrix creation and extraction of diagonals from a matrix.
Returns the last index in an array or matrix.
Identity matrix.
Creates an array or matrix filled with false.
Finds the indices of nonzero (true) elements in an array or matrix.
Rounds numbers toward zero.
Flatten a matrix into an array.
Flip the order of elements in an array or matrix.
Flip a matrix left to right.
Flip a matrix upside down.
Get a column of a matrix.
Get a row of a matrix.
Concatenate arrays or matrices horizontally.
Converts linear index to row and column subscripts.
Concatenates arrays and matrices along the specified dimension.
Create a clone of the input array or matrix.
Generates an array of numbers from start to end with a specified step.
Diagonal matrix creation and extraction of diagonals from a matrix.
Returns the last index in an array or matrix.
Identity matrix.
Creates an array or matrix filled with false.
Finds the indices of nonzero (true) elements in an array or matrix.
Rounds numbers toward zero.
Flatten a matrix into an array.
Flip the order of elements in an array or matrix.
Flip a matrix left to right.
Flip a matrix upside down.
Get a column of a matrix.
Get a row of a matrix.
Concatenate arrays or matrices horizontally.
Converts linear index to row and column subscripts.
Checks if the input is a column vector.
Checks if the input is a row vector.
Checks if the input is a square matrix.
| number
| array<string | number>
| matrix<string | number>
Gets the length of a vector or the largest array dimension.
Create linearly spaced arrays.
Create logarithmically spaced arrays.
Sort array in ascending or descending order.
Returns the number of columns in an array or matrix.
Number of array dimensions.
Returns the number of rows in an array or matrix.
Number of elements in an array or matrix.
Create an array of all ones.
Uniformly distributed pseudorandom numbers.
Replicate and tile an array or matrix.
Reshape an array or matrix into a new matrix of given dimensions.
Set a column of a matrix.
Set a row of a matrix.
Size of an N-D array.
Sorts an array or matrix in ascending or descending order.
Removes singleton dimensions from arrays or matrices.
Converts 2D subscripts to linear indices.
Extract a subset of an array or matrix based on row and column indices.
Extracts elements from an array or matrix based on linear indexing.
Converts a number, boolean, or array into a matrix.
Transpose a matrix or array.
Creates an array filled with true values.
Concatenates arrays or matrices vertically.
Create an array or matrix of all zeros.
Checks if the input is a column vector.
Checks if the input is a row vector.
Checks if the input is a square matrix.
| number
| array<string | number>
| matrix<string | number>
Gets the length of a vector or the largest array dimension.
Create linearly spaced arrays.
Create logarithmically spaced arrays.
Sort array in ascending or descending order.
Returns the number of columns in an array or matrix.
Number of array dimensions.
Returns the number of rows in an array or matrix.
Number of elements in an array or matrix.
Create an array of all ones.
Uniformly distributed pseudorandom numbers.
Replicate and tile an array or matrix.
Reshape an array or matrix into a new matrix of given dimensions.
Set a column of a matrix.
Set a row of a matrix.
Size of an N-D array.
Sorts an array or matrix in ascending or descending order.
Removes singleton dimensions from arrays or matrices.
Converts 2D subscripts to linear indices.
Extract a subset of an array or matrix based on row and column indices.
Extracts elements from an array or matrix based on linear indexing.
Converts a number, boolean, or array into a matrix.
Transpose a matrix or array.
Creates an array filled with true values.
Concatenates arrays or matrices vertically.
Create an array or matrix of all zeros.
Performs the Jarque-Bera test for normality.
Computes the cumulative distribution function (CDF) of a normal distribution.
Computes the inverse of the normal cumulative distribution function (CDF).
Computes the probability density function (PDF) of a normal distribution.
Performs the Jarque-Bera test for normality.
Computes the cumulative distribution function (CDF) of a normal distribution.
Computes the inverse of the normal cumulative distribution function (CDF).
Computes the probability density function (PDF) of a normal distribution.
Computes the Adjusted Sharpe Ratio.
Computes the Annualized Adjusted Sharpe Ratio.
Computes the annualized return.
Computes the Annualized Risk (Standard Deviation).
Computes the Average Drawdown.
Compound Annual Growth Rate.
Computes the Continuous Drawdown.
Historical Conditional Value-At-Risk (CVaR).
Computes the Adjusted Sharpe Ratio.
Computes the Annualized Adjusted Sharpe Ratio.
Computes the annualized return.
Computes the Annualized Risk (Standard Deviation).
Computes the Average Drawdown.
Compound Annual Growth Rate.
Computes the Continuous Drawdown.
Historical Conditional Value-At-Risk (CVaR).
Internal rate of return on an investment based on a series of periodic cash flows.
Modified Dietz Return.
Modigliani-Modigliani measure (M2).
Percentage of positive values in array or matrix.
Convert a return series to a value series with a start value.
Simple Rate of Return.
Computes the Sharpe Ratio.
Convert price series to returns.
Convert a return series to a monthly series.
Convert a time series to a weekly frequency.
Tracking Error (ex-post).
True Time-weighted return.
Internal rate of return on an investment based on a series of periodic cash flows.
Modified Dietz Return.
Modigliani-Modigliani measure (M2).
Percentage of positive values in array or matrix.
Convert a return series to a value series with a start value.
Simple Rate of Return.
Computes the Sharpe Ratio.
Convert price series to returns.
Convert a return series to a monthly series.
Convert a time series to a weekly frequency.
Tracking Error (ex-post).
True Time-weighted return.
Linear interpolation.
Linear regression of Y on X.
Linear interpolation.
Linear regression of Y on X.
Correlation coefficients of arrays.
Correlation coefficients of arrays.
Interquartile range.
Computes the kurtosis of a dataset.
Mean absolute deviation.
Largest element in array.
Average value of array or matrix.
Median value of array.
Smallest element in array.
Most frequent value in an array.
Computes the central moment of a dataset.
Pairwise distance between two sets of observations.
Percentiles of a sample.
Quantiles of a sample.
Quartiles of a sample.
Range of values.
Computes the skewness of a dataset.
Computes the standard deviation.
Computes the variance.
Standardized Z score.
Interquartile range.
Computes the kurtosis of a dataset.
Mean absolute deviation.
Largest element in array.
Average value of array or matrix.
Median value of array.
Smallest element in array.
Most frequent value in an array.
Computes the central moment of a dataset.
Pairwise distance between two sets of observations.
Percentiles of a sample.
Quantiles of a sample.
Quartiles of a sample.
Computes the skewness of a dataset.
Computes the standard deviation.
Computes the variance.
Standardized Z score.
Options for quantitative finance calculations
-
method: "simple" | "continuous"
Return calculation method
-
periods: number
Number of periods for annualization
-
riskFreeRate: number
Risk-free rate for Sharpe ratio and similar metrics
Common options for matrix operations
-
dim: Dimension
Dimension along which to operate (0: rows, 1: columns)
-
flag: NormalizationFlag
Normalization flag (0: population, 1: sample)
Options for statistical calculations
-
percentile: number
Percentile value (0-100) for quantile calculations
Represents a one-dimensional array of numbers.
Dimension parameter for matrix operations
Represents a two-dimensional array of numbers.
Two-dimensional matrix result
Normalization flag for statistical calculations
Union type for numeric, array, or matrix values
Union of all possible numeric result types
Single numeric value result
One-dimensional array result