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
Also works for lower triangular matrices
# NOT RUN { 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