define_model: Defining the Model

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Give the complete formula and generate the expected kernel library.

Usage

1
define_model(formula, label_names, data, kern_par)

Arguments

formula

(formula) A symbolic description of the model to be fitted.

label_names

(list) A character string indicating all the interior variables included in each predictor. See Details.

data

(dataframe, n*P) A dataframe to be fitted. See Details.

kern_par

(dataframe, K*4) A dataframe indicating the parameters of base kernels to be created. See Details.

Details

It processes data based on formula and label_names and creates a kernel library according to the parameters given in kern_par.

* label_names: for two subgroups with sizes p1 and p2 respectively, label_names contains two elements. The length of the first element is p1, indicating the names of p1 interiors variables, and the length of second one is p2, indicating the names of p2 interiors variables.

* data: for a data with n observations and P=p1+p2 variables (with sub-groups of sizes (p1, p2)), the dimension of dataframe is n*P. All entries should be numeric and the column name of response is "Y", while the column names of P variables are the ones from label_names.

* kern_par: for a library of K kernels, the dimension of this dataframe is K*4. Each row represents a kernel. The first column is method, with entries of character class. The second is Sigma, with entries of matrix class, indicating the covariance matrix for neural network kernel (default=0). The third and the fourth are l and p respectively, both with entries of numeric class.

Value

Y

(vector of length n) Reponses of the dataframe.

X1

(dataframe, n*p1) The first type of factor in the dataframe (could contains several subfactors).

X2

(dataframe, n*p2) The second type of factor in the dataframe (could contains several subfactors).

kern_list

(list of length K) A list of kernel functions given by user.

Author(s)

Wenying Deng

See Also

method: generate_kernel

Examples

1
2
3
4
5
6
kern_par <- data.frame(method = c("rbf", "polynomial", "matern"), 
Sigma = rep(0, 3), l = c(.5, 1, 1.5), p = 1:3)
kern_par$method <- as.character(kern_par$method)
define_model(formula = Y ~ X1 + X2,
label_names = list(X1 = c("x1", "x2"), X2 = c("x3", "x4")),
data = dora, kern_par)

IrisTeng/CVEK documentation built on May 31, 2019, 4:50 p.m.