Function to convert a correlation matrix to a covariance matrix.
cor2cov(cor.mat, sd, discrepancy=1e-5)
the correlation matrix to be converted
a vector that contains the standard deviations of the variables in the correlation matrix
a neighborhood of 1, such that numbers on the main diagonal of the correlation matrix will be considered as equal to 1 if they fall in this neighborhood
Ken Kelley (University of Notre Dame; KKelley@ND.Edu), Keke Lai
The correlation matrix to convert can be either symmetric or triangular. The covariance matrix returned is always a symmetric matrix.