covGivens {spBayes}R Documentation

Returns covariance matrix C given components of P and L in C=PLP'

Description

Given components of P and L in C=PLP', covGivens returns C.

Usage

 covGivens(theta, lambda, p, strict=TRUE)

Arguments

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.

Details

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.

Value

A list with the following tags:

C pxp covariance matrix.
P pxp P matrix.
Lambda diagonal elements of the pxp L matrix.

Author(s)

Andrew O. Finley finleya@msu.edu,
Sudipto Banerjee sudiptob@biostat.umn.edu,

References

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.

Examples


## 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)

[Package spBayes version 0.1-2 Index]