library("strucchange")
X <- matrix(c(1,2,2,8), ncol=2)
test <- root.matrix(X)
## control results
X [,1] [,2]
[1,] 1 2
[2,] 2 8
test %*% test [,1] [,2]
[1,] 1 2
[2,] 2 8
Computes the root of a symmetric and positive semidefinite matrix.
root.matrix(X)
X
|
a symmetric and positive semidefinite matrix |
a symmetric matrix of same dimensions as X
library("strucchange")
X <- matrix(c(1,2,2,8), ncol=2)
test <- root.matrix(X)
## control results
X [,1] [,2]
[1,] 1 2
[2,] 2 8
test %*% test [,1] [,2]
[1,] 1 2
[2,] 2 8