Description Usage Arguments Details Value Author(s) Examples
Converts a correlation matrix into a covariance matrix using variance information. It is therefore the opposite of cov2cor
.
1 |
C |
a symmetric numeric correlation matrix \mathbf{C}. |
var |
a vector of variances σ_n^2. |
Calculates the covariance matrix \mathbf{Σ} using a correlation matrix \mathbf{C} and outer products of the standard deviations σ_n:
\mathbf{Σ} = \mathbf{C} \cdot σ_n \otimes σ_n
The corresponding covariance matrix.
Andrej-Nikolai Spiess
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Example in Annex H.2 from the GUM 2008 manual
## (see 'References'), simultaneous resistance
## and reactance measurement.
data(H.2)
attach(H.2)
## Original covariance matrix.
COV <- cov(H.2)
## extract variances
VAR <- diag(COV)
## cor2cov covariance matrix.
COV2 <- cor2cov(cor(H.2), VAR)
## Equal to original covariance matrix.
all.equal(COV2, COV)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.