powered by
Symmetrize an upper triangular matrix by copying the upper triangular elements into the lower triangular places
symmetrize(a)
Upper triangular matrix to be symmetrized
Robin K. S. Hankin
Also works for lower triangular matrices
jj <- matrix(rnorm(50),10,5) X <- crossprod(jj,jj) # X has a Wishart distribution (and in # particular is positive definite) chol(X) symmetrize(chol(X))
Run the code above in your browser using DataLab