corLevDiag {kergp} | R Documentation |
Correlation or Covariance Matrix for a Diagonal Structure
Description
Compute the correlation or covariance matrix for a diagonal structure.
Usage
corLevDiag(par, nlevels, levels, lowerSQRT = FALSE, compGrad = TRUE,
cov = 0)
Arguments
par |
A numeric vector with length |
nlevels |
Number of levels. |
levels |
Character representing the levels. |
lowerSQRT |
Logical. When |
compGrad |
Logical. Should the gradient be computed? |
cov |
Integer |
Value
A correlation matrix (or its Cholesky root) with the
optional gradient
attribute.
Examples
set.seed(123)
checkGrad <- TRUE
nlevels <- 12
sigma2 <- rexp(n = nlevels)
T0 <- corLevDiag(nlevels = nlevels, par = sigma2, cov = 2)
L0 <- corLevDiag(nlevels = nlevels, par = sigma2, cov = 2,
lowerSQRT = TRUE)