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)
|
Loading required package: MASS
Loading required package: tmvtnorm
Loading required package: mvtnorm
Loading required package: Matrix
Loading required package: stats4
Loading required package: gmm
Loading required package: sandwich
Loading required package: Rcpp
Loading required package: ff
Loading required package: bit
Attaching package bit
package:bit (c) 2008-2012 Jens Oehlschlaegel (GPL-2)
creators: bit bitwhich
coercion: as.logical as.integer as.bit as.bitwhich which
operator: ! & | xor != ==
querying: print length any all min max range sum summary
bit access: length<- [ [<- [[ [[<-
for more help type ?bit
Attaching package: 'bit'
The following object is masked from 'package:base':
xor
Attaching package ff
- getOption("fftempdir")=="/work/tmp/tmp/Rtmpbd0XpW"
- getOption("ffextension")=="ff"
- getOption("ffdrop")==TRUE
- getOption("fffinonexit")==TRUE
- getOption("ffpagesize")==65536
- getOption("ffcaching")=="mmnoflush" -- consider "ffeachflush" if your system stalls on large writes
- getOption("ffbatchbytes")==16777216 -- consider a different value for tuning your system
- getOption("ffmaxbytes")==536870912 -- consider a different value for tuning your system
Attaching package: 'ff'
The following objects are masked from 'package:bit':
clone, clone.default, clone.list
The following objects are masked from 'package:utils':
write.csv, write.csv2
The following objects are masked from 'package:base':
is.factor, is.ordered
Loading required package: minpack.lm
[1] TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.