symmetrize {QRMlib}R Documentation

Ensure Symmetric Matrix

Description

ensures a matrix that should be symmetric is really symmetric

Usage

symmetrize(matrix)

Arguments

matrix a matrix that should be symmetric

Details

deals with situations where rounding errors cause symmetric matrices to appear asymmetric

Value

a matrix that is symmetric

Examples

## Not run: 
#lines of code taken from fit.mst() in functionsNormix.R
# ...
Sigma <- var(data);
Sigma <- symmetrize(Sigma);
beta <- as.vector(solve(Sigma) 
mean <- as.numeric(mu+EW*gamma);
covariance <- EW*Sigma + varW*outer(gamma,gamma);
## End(Not run)

[Package QRMlib version 1.4.4 Index]