Matrices reference

All 5 matrices in AlgoBarsX, each with its parameters, defaults, ranges and an example: matrix, transpose, multiply, inverse, covariance_matrix.

matrix transpose multiply inverse covariance_matrix

matrix(rows, columns, fill = 0)→ matrix#

A numeric matrix filled with a value.

Parameters

NameTypeDefaultWhat it is
rowsintrequiredRows.
columnsintrequiredColumns.
fillnumber0Initial value.
Example
grid = matrix(3, 3)
strategyindicatoralertlibrarysince 1.0

transpose(m)→ matrix#

Transpose a matrix.

Parameters

NameTypeDefaultWhat it is
mmatrixrequiredMatrix.
Example
flipped = transpose(grid)
strategyindicatoralertlibrarysince 1.0

multiply(a, b)→ matrix#

Matrix product.

Parameters

NameTypeDefaultWhat it is
amatrixrequiredLeft matrix.
bmatrixrequiredRight matrix.
Example
product = multiply(grid, transpose(grid))
strategyindicatoralertlibrarysince 1.0

inverse(m)→ matrix#

Matrix inverse; na when the matrix is singular.

Parameters

NameTypeDefaultWhat it is
mmatrixrequiredSquare matrix.
Example
inv = inverse(grid)
strategyindicatoralertlibrarysince 1.0

covariance_matrix(series, length = 100)→ matrix#

Covariance matrix of several series.

Parameters

NameTypeDefaultRangeWhat it is
serieslist<series<number>>requiredSeries to compare.
lengthint1001 to 5000Number of bars in the calculation.
Example
cov_m = covariance_matrix([returns(close_of(EURUSD)), returns(close_of(GBPUSD))], 100)
strategyindicatoralertlibrarysince 1.0

Try this in the Terminal. AlgoBars is free: $0 a month, no card needed.

Create my free account