cov.mat {ILSE} | R Documentation |
Generate Two Type of Covariance Matrix
Description
Generate two type of covariance matrix
Usage
cov.mat(sdvec,rho, type='toeplitz')
Arguments
sdvec |
a positive vector, standard deviation of each random variable. |
rho |
a value between 0 and 1, a baseline vlaue of correlation coefficient. |
type |
a character, specify the type of correlation matrix and only include 'toeplitz' and 'identity' in current version. |
Details
The argument rho specify the size of correlation coeffient. As for argument type, if type='toeplitz', sigma_ij=rho^|i-j|; if type ='identity', sigma_ij=rho when i!=j and sigma_ij=1 when i=j.
Value
return a covariance matrix with a type of specified structure.
Note
nothing
Author(s)
Liu Wei
References
nothing.
See Also
cov2cor
Examples
cov.mat(rep(5,5), 0.5)
cov.mat(c(2,4,3), 0.5, type='identity')
[Package ILSE version 1.1.7 Index]