q1CompSymm {kergp}R Documentation

Qualitative Correlation or Covariance Kernel with one Input and Compound Symmetric Correlation

Description

Qualitative correlation or covariance kernel with one input and compound symmetric correlation.

Usage


q1CompSymm(factor, input = "x", cov = c("corr", "homo"), intAsChar = TRUE)

Arguments

factor

A factor with the wanted levels for the covariance kernel object.

input

Name of (qualitative) input for the kernel.

cov

Character telling if the kernel is a correlation kernel or a homoscedastic covariance kernel.

intAsChar

Logical. If TRUE (default), an integer-valued input will be coerced into a character. Otherwise, it will be coerced into a factor.

Value

An object with class "covQual" with d = 1 qualitative input.

Note

Correlation kernels are needed in tensor products because the tensor product of two covariance kernels each with unknown variance would not be identifiable.

See Also

The corLevCompSymm function used to compute the correlation matrix and its gradients w.r.t. the correlation parameters.

Examples

School <- factor(1L:3L, labels = c("Bad", "Mean" , "Good"))
myCor <- q1CompSymm(School, input = "School")
coef(myCor) <- 0.26
plot(myCor, type = "cor")

## Use a data.frame with a factor
set.seed(246)
newSchool <- factor(sample(1L:3L, size = 20, replace = TRUE),
                    labels = c("Bad", "Mean" , "Good"))
C1 <- covMat(myCor, X = data.frame(School = newSchool),
             compGrad = FALSE, lowerSQRT = FALSE)


[Package kergp version 0.5.7 Index]