q1Symm: Qualitative Correlation or Covariance Kernel with one Input...

Description Usage Arguments Value Note See Also Examples

View source: R/q1Symm.R

Description

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

Usage

1
  q1Symm(factor, input = "x", cov = c("corr", "homo", "hete"), 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 result is a correlation kernel, an homoscedastic covariance kernel or an heteroscedastic covariance kernel with an arbitrary variance vector.

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 corLevSymm function used to compute the correlation matrix and its gradients w.r.t. the correlation parameters.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
School <- factor(1L:3L, labels = c("Bad", "Mean" , "Good"))
myCor <- q1Symm(School, input = "School")
coef(myCor) <- c(theta_2_1 = pi / 3, theta_3_1 = pi / 4, theta_3_2 = pi / 8)
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)

kergp documentation built on March 18, 2021, 5:06 p.m.