Learn R Programming

kergp (version 0.5.7)

q1Diag: Qualitative Correlation or Covariance Kernel with one Input and Diagonal Structure

Description

Qualitative correlation or covariance kernel with one input and diagonal structure.

Usage

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

Value

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

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.

See Also

q1Symm, q1CompSymm are other covariance structures for one qualitative input.

Examples

Run this code
School <- factor(1L:3L, labels = c("Bad", "Mean" , "Good"))

## correlation: no parameter!
myCor <- q1Diag(School, input = "School")

## covariance 
myCov <- q1Diag(School, input = "School", cov = "hete")
coef(myCov) <- c(1.1, 2.2, 3.3)

Run the code above in your browser using DataLab