datatype/assertarray.ts

Functions

f
assertarray(x: unknown): asserts x is array

Asserts that a value is a 1D array.

datatype/assertdimension.ts

Functions

f
assertdimension(dim: unknown): asserts dim is Dimension

Asserts that a value is a valid dimension (0 or 1).

datatype/assertmatrix.ts

Functions

f
assertmatrix(x: unknown): asserts x is matrix

Asserts that a value is a 2D matrix.

datatype/clock.ts

Functions

f
clock(): array

Retrieves the current date and time as a date vector.

datatype/datenum.ts

Functions

f
datenum(
d: string | array<string | number>,
fmt?: string
): number | array

Convert date and time to a serial date number (Unix).

datatype/index.ts

Functions

f
assertarray(x: unknown): asserts x is array

Asserts that a value is a 1D array.

f
assertdimension(dim: unknown): asserts dim is Dimension

Asserts that a value is a valid dimension (0 or 1).

f
assertmatrix(x: unknown): asserts x is matrix

Asserts that a value is a 2D matrix.

f
assertnormalizationflag(flag: unknown): asserts flag is NormalizationFlag

Asserts that a value is a valid normalization flag (0 or 1).

f
assertnumber(x: unknown): asserts x is number

Asserts that a value is a number.

f
clock(): array

Retrieves the current date and time as a date vector.

f
datenum(
d: string | array<string | number>,
fmt?: string
): number | array

Convert date and time to a serial date number (Unix).

f
isarray(x: unknown): x is array<any>

Checks if the input is a 1D array.

f
isempty(x: unknown): boolean

Checks if an array or matrix is empty.

f
isfunction(x: unknown): boolean

Checks if the input is a function.

f
isinteger(x: unknown): boolean

Checks if the input is an integer.

f
islogical(x: unknown): x is boolean

Checks if the input is a boolean.

f
ismatrix(x: unknown): x is matrix

True for matrix (2D array with consistent row lengths).

f
isnull(x: unknown): boolean

True for null values.

f
isscalar(x: unknown): boolean

Checks if the input is a scalar value.

f
issingular(x: unknown): boolean

Checks if a matrix is singular (non-invertible).

f
isstring(x: unknown): x is string

Checks if the input is a string.

f
isundefined(x: unknown): x is undefined

Checks if the input is undefined.

f
isvector(x: unknown): x is matrix

Checks if the input is a vector.

f
now(): number

Current date and time as a Unix timestamp.

f
randchar(
n?: number,
strset?: string
): string

Generates a random alphanumeric string.

f
strfind(
str: string,
pattern: string
): array

Finds all occurrences of a substring within a string.

f
today(): number

Gets the current date as a Unix timestamp.

f
weekday(x: number | array | matrix): number | array | matrix
3 overloads

Gets the ISO weekday for a given Unix timestamp.

datatype/isarray.ts

Functions

f
isarray(x: unknown): x is array<any>

Checks if the input is a 1D array.

datatype/isempty.ts

Functions

f
isempty(x: unknown): boolean

Checks if an array or matrix is empty.

datatype/isfunction.ts

Functions

f
isfunction(x: unknown): boolean

Checks if the input is a function.

datatype/isinteger.ts

Functions

f
isinteger(x: unknown): boolean

Checks if the input is an integer.

datatype/islogical.ts

Functions

f
islogical(x: unknown): x is boolean

Checks if the input is a boolean.

datatype/ismatrix.ts

Functions

f
ismatrix(x: unknown): x is matrix

True for matrix (2D array with consistent row lengths).

datatype/isnull.ts

Functions

f
isnull(x: unknown): boolean

True for null values.

datatype/isscalar.ts

Functions

f
isscalar(x: unknown): boolean

Checks if the input is a scalar value.

datatype/issingular.ts

Functions

f
issingular(x: unknown): boolean

Checks if a matrix is singular (non-invertible).

datatype/isstring.ts

Functions

f
isstring(x: unknown): x is string

Checks if the input is a string.

datatype/isundefined.ts

Functions

f
isundefined(x: unknown): x is undefined

Checks if the input is undefined.

datatype/isvector.ts

Functions

f
isvector(x: unknown): x is matrix

Checks if the input is a vector.

datatype/now.ts

Functions

f
now(): number

Current date and time as a Unix timestamp.

datatype/randchar.ts

Functions

f
randchar(
n?: number,
strset?: string
): string

Generates a random alphanumeric string.

datatype/strfind.ts

Functions

f
strfind(
str: string,
pattern: string
): array

Finds all occurrences of a substring within a string.

datatype/today.ts

Functions

f
today(): number

Gets the current date as a Unix timestamp.

elemop/dot.ts

Functions

f
dot(
x: array,
y: array
): number

Computes the dot product of two arrays.

elemop/index.ts

Functions

f
dot(
x: array,
y: array
): number

Computes the dot product of two arrays.

f
times(
x: numarraymatrix,
y: numarraymatrix
): numarraymatrix
7 overloads

Element-wise multiplication of arrays, matrices, or numbers.

elemop/times.ts

Functions

f
times(
x: numarraymatrix,
y: numarraymatrix
): numarraymatrix
7 overloads

Element-wise multiplication of arrays, matrices, or numbers.

elmath/erf.ts

Functions

f
erf(x: number): number

Error function.

elmath/erfc.ts

Functions

f
erfc(x: number): number

Complementary error function.

elmath/erfcinv.ts

Functions

f
erfcinv(y: number): number

Inverse complementary error function.

elmath/erfinv.ts

Functions

f
erfinv(y: number): number

Inverse error function.

elmath/exp.ts

Functions

elmath/index.ts

Functions

f
erf(x: number): number

Error function.

f
erfc(x: number): number

Complementary error function.

f
erfcinv(y: number): number

Inverse complementary error function.

f
erfinv(y: number): number

Inverse error function.

f
log(x: numarraymatrix): numarraymatrix
3 overloads

Computes the natural logarithm (base e).

f
sign(x: number): number

Computes the sign of a number.

f
sqrt(x: numarraymatrix): numarraymatrix
6 overloads

Computes the square root of a number, array, or matrix.

elmath/log.ts

Functions

f
log(x: numarraymatrix): numarraymatrix
3 overloads

Computes the natural logarithm (base e).

elmath/sign.ts

Functions

f
sign(x: number): number

Computes the sign of a number.

elmath/sqrt.ts

Functions

f
sqrt(x: numarraymatrix): numarraymatrix
6 overloads

Computes the square root of a number, array, or matrix.

linalgebra/det.ts

Functions

f
det(x: matrix): number

Matrix determinant.

linalgebra/index.ts

Functions

f
det(x: matrix): number

Matrix determinant.

f
inv(x: number | matrix): number | matrix
2 overloads

Computes the inverse of a square matrix.

f
linsolve(
A: matrix,
b: array | matrix
): array | matrix

Solve a linear system of equations Ax = b.

linalgebra/inv.ts

Functions

f
inv(x: number | matrix): number | matrix
2 overloads

Computes the inverse of a square matrix.

linalgebra/linsolve.ts

Functions

f
linsolve(
A: matrix,
b: array | matrix
): array | matrix

Solve a linear system of equations Ax = b.

matarrs/cat.ts

Functions

f
cat(
dim: number,
...args: (number | array | matrix)[]
): array | matrix

Concatenates arrays and matrices along the specified dimension.

matarrs/clone.ts

Functions

f
clone<T extends numarraymatrix>(x: T): T

Create a clone of the input array or matrix.

matarrs/colon.ts

Functions

f
colon(
start: number,
end: number,
step?: number
): array

Generates an array of numbers from start to end with a specified step.

matarrs/diag.ts

Functions

f
diag(
x: array | matrix,
k?: number
): array | matrix
4 overloads

Diagonal matrix creation and extraction of diagonals from a matrix.

matarrs/end.ts

Functions

f
end(
x: number | array | matrix,
dim?: number
): number | array

Returns the last index in an array or matrix.

matarrs/falses.ts

Functions

f
falses(...args: (number | array)[]): matrix<boolean>

Creates an array or matrix filled with false.

matarrs/find.ts

Functions

f
find(x: array<boolean | number> | matrix<boolean | number>): array

Finds the indices of nonzero (true) elements in an array or matrix.

matarrs/getcol.ts

Functions

f
getcol(
x: matrix,
n: number
): array

Get a column of a matrix.

matarrs/horzcat.ts

Functions

f
horzcat(...args: (number | array | matrix)[]): array | matrix

Concatenate arrays or matrices horizontally.

matarrs/ind2sub.ts

Functions

f
ind2sub(
size: array,
index: number | array
): array | matrix

Converts linear index to row and column subscripts.

matarrs/index.ts

Functions

f
cat(
dim: number,
...args: (number | array | matrix)[]
): array | matrix

Concatenates arrays and matrices along the specified dimension.

f
clone<T extends numarraymatrix>(x: T): T

Create a clone of the input array or matrix.

f
colon(
start: number,
end: number,
step?: number
): array

Generates an array of numbers from start to end with a specified step.

f
diag(
x: array | matrix,
k?: number
): array | matrix
4 overloads

Diagonal matrix creation and extraction of diagonals from a matrix.

f
end(
x: number | array | matrix,
dim?: number
): number | array

Returns the last index in an array or matrix.

f
falses(...args: (number | array)[]): matrix<boolean>

Creates an array or matrix filled with false.

f
find(x: array<boolean | number> | matrix<boolean | number>): array

Finds the indices of nonzero (true) elements in an array or matrix.

f
flipdim(
x: number | array | matrix,
dim?: number
): number | array | matrix

Flip the order of elements in an array or matrix.

f
getcol(
x: matrix,
n: number
): array

Get a column of a matrix.

f
f
horzcat(...args: (number | array | matrix)[]): array | matrix

Concatenate arrays or matrices horizontally.

f
ind2sub(
size: array,
index: number | array
): array | matrix

Converts linear index to row and column subscripts.

f
iscolumn(x: unknown): x is matrix

Checks if the input is a column vector.

f
isrow(x: unknown): x is matrix

Checks if the input is a row vector.

f
issquare(x: unknown): boolean

Checks if the input is a square matrix.

f
length(x:
string
| number
| array<string | number>
| matrix<string | number>
): number

Gets the length of a vector or the largest array dimension.

f
f
logspace(
a: number,
b: number,
n?: number
): array

Create logarithmically spaced arrays.

f
mergesort(
x: array | [array, array],
mode?: string
): [array, array]

Sort array in ascending or descending order.

f
ncols(x: array | matrix): number

Returns the number of columns in an array or matrix.

f
ndims(x: array | matrix): number

Number of array dimensions.

f
nrows(x: array | matrix): number

Returns the number of rows in an array or matrix.

f
numel(x: array | matrix): number

Number of elements in an array or matrix.

f
rand(...args: unknown[]): number | matrix
4 overloads

Uniformly distributed pseudorandom numbers.

f
reshape(
x: array | matrix,
m: number,
n: number,
flag?: 0 | 1
): matrix

Reshape an array or matrix into a new matrix of given dimensions.

f
size(x: unknown): array

Size of an N-D array.

f
sort(
x: unknown,
mode?: string,
dim?: number
): unknown
3 overloads

Sorts an array or matrix in ascending or descending order.

f
squeeze<T>(x: NestedArray<T>): NestedArray<T>

Removes singleton dimensions from arrays or matrices.

f
sub2ind(
size: array,
index: array | matrix
): number | array

Converts 2D subscripts to linear indices.

f
subsetlin(
m: unknown,
idx: unknown,
flag?: 0 | 1
): unknown
2 overloads

Extracts elements from an array or matrix based on linear indexing.

f
f
vertcat(...args: (numarraymatrix)[]): array | matrix

Concatenates arrays or matrices vertically.

matarrs/iscolumn.ts

Functions

f
iscolumn(x: unknown): x is matrix

Checks if the input is a column vector.

matarrs/isrow.ts

Functions

f
isrow(x: unknown): x is matrix

Checks if the input is a row vector.

matarrs/issquare.ts

Functions

f
issquare(x: unknown): boolean

Checks if the input is a square matrix.

matarrs/length.ts

Functions

f
length(x:
string
| number
| array<string | number>
| matrix<string | number>
): number

Gets the length of a vector or the largest array dimension.

matarrs/logspace.ts

Functions

f
logspace(
a: number,
b: number,
n?: number
): array

Create logarithmically spaced arrays.

matarrs/ncols.ts

Functions

f
ncols(x: array | matrix): number

Returns the number of columns in an array or matrix.

matarrs/ndims.ts

Functions

f
ndims(x: array | matrix): number

Number of array dimensions.

matarrs/nrows.ts

Functions

f
nrows(x: array | matrix): number

Returns the number of rows in an array or matrix.

matarrs/numel.ts

Functions

f
numel(x: array | matrix): number

Number of elements in an array or matrix.

matarrs/rand.ts

Functions

f
rand(...args: unknown[]): number | matrix
4 overloads

Uniformly distributed pseudorandom numbers.

matarrs/reshape.ts

Functions

f
reshape(
x: array | matrix,
m: number,
n: number,
flag?: 0 | 1
): matrix

Reshape an array or matrix into a new matrix of given dimensions.

matarrs/size.ts

Functions

f
size(x: unknown): array

Size of an N-D array.

matarrs/sort.ts

Functions

f
sort(
x: unknown,
mode?: string,
dim?: number
): unknown
3 overloads

Sorts an array or matrix in ascending or descending order.

matarrs/squeeze.ts

Functions

f
squeeze<T>(x: NestedArray<T>): NestedArray<T>

Removes singleton dimensions from arrays or matrices.

Type Aliases

matarrs/sub2ind.ts

Functions

f
sub2ind(
size: array,
index: array | matrix
): number | array

Converts 2D subscripts to linear indices.

matarrs/subsetlin.ts

Functions

f
subsetlin(
m: unknown,
idx: unknown,
flag?: 0 | 1
): unknown
2 overloads

Extracts elements from an array or matrix based on linear indexing.

matarrs/vertcat.ts

Functions

f
vertcat(...args: (numarraymatrix)[]): array | matrix

Concatenates arrays or matrices vertically.

probdistr/index.ts

Functions

f
jbtest(x: array): number

Performs the Jarque-Bera test for normality.

f
normcdf(
x: number,
mu?: number,
sigma?: number
): number

Computes the cumulative distribution function (CDF) of a normal distribution.

f
norminv(
p: number,
mu?: number,
sigma?: number
): number

Computes the inverse of the normal cumulative distribution function (CDF).

f
normpdf(
x: number,
mu?: number,
sigma?: number
): number

Computes the probability density function (PDF) of a normal distribution.

probdistr/jbtest.ts

Functions

f
jbtest(x: array): number

Performs the Jarque-Bera test for normality.

probdistr/normcdf.ts

Functions

f
normcdf(
x: number,
mu?: number,
sigma?: number
): number

Computes the cumulative distribution function (CDF) of a normal distribution.

probdistr/norminv.ts

Functions

f
norminv(
p: number,
mu?: number,
sigma?: number
): number

Computes the inverse of the normal cumulative distribution function (CDF).

probdistr/normpdf.ts

Functions

f
normpdf(
x: number,
mu?: number,
sigma?: number
): number

Computes the probability density function (PDF) of a normal distribution.

quants/index.ts

Functions

f
irr(
cf: array,
cfd?: array,
cd?: number,
guess?: number
): number

Internal rate of return on an investment based on a series of periodic cash flows.

f
percpos(
x: numarraymatrix,
dim?: 0 | 1
): number | array | matrix
2 overloads

Percentage of positive values in array or matrix.

f
tomonthly(
x: array,
mode?: string
): number
1 overloads

Convert a return series to a monthly series.

f
toweekly(
nd: array,
nv: array | matrix
): [array, array | matrix]

Convert a time series to a weekly frequency.

quants/irr.ts

Functions

f
irr(
cf: array,
cfd?: array,
cd?: number,
guess?: number
): number

Internal rate of return on an investment based on a series of periodic cash flows.

quants/tomonthly.ts

Functions

f
tomonthly(
x: array,
mode?: string
): number
1 overloads

Convert a return series to a monthly series.

quants/toweekly.ts

Functions

f
toweekly(
nd: array,
nv: array | matrix
): [array, array | matrix]

Convert a time series to a weekly frequency.

quants/twr.ts

Functions

stats/index.ts

Functions

types.d.ts

Interfaces

I
FinancialOptions

Options for quantitative finance calculations

I
MatrixOperationOptions

Common options for matrix operations

I
StatisticsOptions

Options for statistical calculations

Type Aliases

T
array<T = number> = T[]

Represents a one-dimensional array of numbers.

T
Dimension = 0 | 1

Dimension parameter for matrix operations

T
matrix<T = number> = T[][]

Represents a two-dimensional array of numbers.

T
MatrixResult = matrix

Two-dimensional matrix result

T
NormalizationFlag = 0 | 1

Normalization flag for statistical calculations

T
numarraymatrix<T = number> = T | array<T> | matrix<T>

Union type for numeric, array, or matrix values

T
NumericResult = ScalarResult | VectorResult | MatrixResult

Union of all possible numeric result types

T
ScalarResult = number

Single numeric value result

T
VectorResult = array

One-dimensional array result