Learn R Programming

covKCD (version 0.1)

msqrt: Symmetric square root of a matrix

Description

Compute the symmetric square root of a matrix.

Usage

msqrt(M)

Value

a positive semidefinite matrix.

Arguments

M

a positive semidefinite matrix.

Author

Peter Hoff

Examples

Run this code
S<-rWishart(1,5,diag(5))[,,1]
S 
Sh<-msqrt(S)
Sh%*%Sh 

Run the code above in your browser using DataLab