Library: | math |
See also: | VaRDGdecomp |
Quantlet: | DGdecompS | |
Description: | computes the square root of a positive semi-definite matrix, using an eigen value decomposition |
Usage: | B = DGdecompS(Sigma) | |
Input: | ||
Sigma | p x p positive semi-definite matrix containing user-defined data. | |
Output: | ||
B | p x p matrix containing the square root of Sigma. Note that the solution is non-unique. B solves the equation: BB' = Sigma. |
library("math") Sigma = matrix(3,3) + 10*unit(3) B=DGdecompS(Sigma) B B*B'
Contents of B [1,] 2.2361 2.0817 -1.291 [2,] -2.2361 2.0817 -1.291 [3,] 0 2.0817 2.582 Contents of _tmp [1,] 11 1 1 [2,] 1 11 1 [3,] 1 1 11