powered by
Takes a square symmetric positive definite or positive semidefinite matrix and returns a Cholesky factor.
chol_psd(a)
A matrix
The lower triangular Cholesky factor
# NOT RUN { X=replicate(100,rnorm(99)) #a is positive semidefinite but not positive definite a_0=t(X)%*%X b=chol_psd(a_0) #recover a a_1=b%*%t(b) diff=max(abs(a_1-a_0)) # }
Run the code above in your browser using DataLab