Learn R Programming

kergp (version 0.5.7)

covQual-class: Class "covQual"

Description

Covariance kernel for qualitative inputs.

Arguments

Objects from the Class

Objects can be created by calls of the form new("covQual", ...).

Slots

covLevels:

Object of class "function". This function has arguments 'par' and optional arguments lowerSQRT and compGrad. It returns the covariance matrix for an input corresponding to all the levels.

covLevMat:

Object of class "matrix". This is the result returned by the function covLevels (former slot) with lowerSQRT = FALSE and gradient = FALSE.

hasGrad:

Object of class "logical". When TRUE, the covariance matrix returned by the function in slot covLevels must compute the gradients. The returned covariance matrix must have a "gradient" attribute; this must be an array with dimension c(m, m, np) where m stands for the number of levels and \(np\) is the number of parameters.

acceptLowerSQRT:

Object of class "logical". When TRUE, the function in slot covLevels must have a formal lowerSQRT which can receive a logical value. When the value is TRUE the Cholesky (lower) root of the covariance is returned instead of the covariance.

label:

Object of class "character". A description of the kernel which will remained attached with it.

d:

Object of class "integer". The dimension or number of (qualitative) inputs of the kernel.

inputNames:

Object of class "character". The names of the (qualitative) inputs. These will be matched against the columns of a data frame when the kernel will be evaluated.

nlevels:

Object of class "integer". A vector with length d giving the number of levels for each of the d inputs.

levels:

Object of class "list". A list of length d containing the d character vectors of levels for the d (qualitative) inputs.

parLower:

Object of class "numeric". Vector of parN lower values for the parameters of the structure. The value -Inf can be used when needed.

parUpper:

Object of class "numeric". Vector of parN upper values for the parameters of the structure. The value Inf can be used when needed.

par:

Object of class "numeric". Vector of parN current values for the structure.

parN:

Object of class "integer". Number of parameters for the structure, as returned by the npar method.

kernParNames:

Object of class "character". Vector of length parN giving the names of the parameters. E.g. "range", "var", "sigma2" are popular names.

ordered:

Vector of class "logical" indicating whether the factors are ordered or not.

intAsChar:

Object of class "logical" indicating how to cope with an integer input. When intAsChar is TRUE the input is coerced into a character; the values taken by this character vector should then match the levels in the covQual object as given by levels(object)[[1]]. If instead intAsChar is FALSE, the integer values are assumed to correspond to the levels of the covQual object in the same order.

Methods

checkX

signature(object = "covQual", X = "data.frame"): check that the inputs exist with suitable column names and suitable factor content. The levels should match the prescribed levels. Returns a matrix with the input columns in the order prescribed by object.

signature(object = "covQual", X = "matrix"): check that the inputs exist with suitable column names and suitable numeric content for coercion into a factor with the prescribed levels. Returns a data frame with the input columns in the order prescribed by object.

coef<-

signature(object = "covQual"): replace the whole vector of coefficients, as required during ML estimation.

coefLower<-

signature(object = "covQual"): replacement method for lower bounds on covQual coefficients.

coefLower

signature(object = "covQual"): extracts the numeric values of the lower bounds.

coef

signature(object = "covQual"): extracts the numeric values of the covariance parameters.

coefUpper<-

signature(object = "covQual"): replacement method for upper bounds on covQual coefficients.

coefUpper

signature(object = "covQual"): ...

covMat

signature(object = "covQual"): build the covariance matrix or the cross covariance matrix between two sets of locations for a covQual object.

npar

signature(object = "covQual"): returns the number of parameters.

plot

signature(x = "covQual"): see plot,covQual-method.

scores

signature(object = "covQual"): return the vector of scores, i.e. the derivative of the log-likelihood w.r.t. the parameter vector at the current parameter values.

simulate

signature(object = "covQual"): simulate nsim paths from a Gaussian Process having the covariance structure. The paths are indexed by the finite set of levels of factor inputs, and they are returned as columns of a matrix.

varVec

signature(object = "covQual"): build the variance vector corresponding to a set locations for a covQual object.

See Also

See covMan for a comparable structure dedicated to kernels with continuous inputs.

Examples

Run this code

showClass("covQual")

Run the code above in your browser using DataLab