Skip to contents

tda_mmul multiplies any number of matrices in order (A1 %*% A2 %*% ... %*% Ak) – TDA's mmul. tda_mtransp transposes – TDA's mtransp. tda_mchol returns the lower-triangular Cholesky factor L such that L %*% t(L) == A (i.e. t(chol(A)) in base R terms; base R's chol returns the upper factor) – TDA's mchol, requiring a positive-definite A.

Usage

tda_mmul(..., dir = tempfile("tda"))

tda_mtransp(A, dir = tempfile("tda"))

tda_mchol(A, dir = tempfile("tda"))

Arguments

...

for tda_mmul, two or more numeric matrices to multiply in order.

dir

working directory.

A

a numeric matrix.

Value

A numeric matrix.

Examples

tda_mmul(matrix(1:4, 2), diag(2))
#>      [,1] [,2]
#> [1,]    1    3
#> [2,]    2    4
tda_mtransp(matrix(1:6, 2))
#>      [,1] [,2]
#> [1,]    1    2
#> [2,]    3    4
#> [3,]    5    6
tda_mchol(matrix(c(4, 2, 2, 3), 2))
#>      [,1]     [,2]
#> [1,]    2 0.000000
#> [2,]    1 1.414214