covGivens {spBayes} | R Documentation |
Given components of P and L in C=PLP', covGivens
returns C.
covGivens(theta, lambda, p, strict=TRUE)
theta |
a p(p-1)/2 vector of Givens angles that are restricted to lie in the interval (-pi/2,pi/2) for uniqueness and positive definiteness of the covariance matrix. These are arranged in column major order in P. |
lambda |
a vector of length p of positive eigenvalues which form the diagonal matrix L. |
p |
refers to the dimension of the desired pxp covariance matrix. |
strict |
checks that theta elements lie in the interval (-pi/2,pi/2) and the lambda elements are positive. |
The spectral decomposition of a matrix C is given by PLP', where P is an orthogonal matrix of eigenvectors and L is a diagonal matrix of positive eigenvalues. In the case of distinct eigenvalues, P can be expressed as P = G_{12}, G_{13}, G_{23}, ..., G_{p-1,p} where G_{i,j} is a pxp matrix with cos(theta_{tl}) in the tth and lth diagonal elements, sin(theta_{tl}) in the tlth and -sin(theta_{tl}) in the ltth elements, zeros on the rest of the off-diagonal elements and 1's on the rest of the diagonal. The p(p-1)/2 angles are called Givens angles and are restricted to lie in the interval (-pi/2,pi/2) for uniqueness and positive definiteness of the resulting covariance matrix.
A list with the following tags:
C |
pxp covariance matrix. |
P |
pxp P matrix. |
Lambda |
diagonal elements of the pxp L matrix. |
Andrew O. Finley finleya@msu.edu,
Sudipto Banerjee sudiptob@biostat.umn.edu,
Daniels, M.J and R.E. Kass (1999) Nonconjugate Bayesian estimation of covariance matrices and its use in hierarchical models, J. Amer. Statist. Assoc. 94:1254-1263.
## Not run: ######################################## ##Syntetic covariance matrix IIIR_1 from ##Daniels, M.J. and R.E. Kass (1999) ##JASA 94(448):1254-1263. ######################################## p <- 5 theta <- rep(pi/4, p*(p-1)/2) lambda <- c(1, 0.75, 0.56, 0.06, 0.003) cov <- covGivens(theta, lambda, p)$C cov2cor(cov) ## End(Not run)