calc_Kv {RKHSMetaMod}R Documentation

Function to calculate the Gram matrices and their eigenvalues and eigenvectors for a chosen reproducing kernel.

Description

Calculates the Gram matrices KvK_v for v=1,,v=1,\ldots,vMax, and returns their associated eigenvalues and eigenvectors. The calculated Gram matrices may be not positive definite. The option "correction" of this function allows to replace the matrices KvK_v that are not positive definite by their "nearest positive definite" matrices.

Usage

calc_Kv(X, kernel, Dmax, correction, verbose, tol)

Arguments

X

Matrix of observations with nn rows and dd columns.

kernel

Character, the type of the reproducing kernel: matern ((matern kernel)), brownian ((brownian kernel)), gaussian ((gaussian kernel)), linear ((linear kernel)), quad ((quadratic kernel)).

Dmax

Integer, between 11 and dd, indicates the order of interactions considered in the meta model: Dmax=1=1 is used to consider only the main effects, Dmax=2=2 to include the main effects and the interactions of order 2,2,\ldots.

correction

Logical, if TRUE, the program makes the correction to the matrices KvK_v that are not positive definite (see details). Set as TRUE by default.

verbose

Logical, if TRUE, the group vv for which the correction is done is printed. Set as TRUE by default.

tol

Scalar, used if correction is TRUE. For each matrix KvK_v if λmin<λmax×\lambda_{min} < \lambda_{max}\timestol, then the correction to KvK_v is done (see details). Set as 1e81e^{-8} by default.

Details

Let λv,i,i=1,...,n\lambda_{v,i},i=1,...,n be the eigenvalues associated with matrix KvK_v. Set λmax=maxiλv,i\lambda_{max}={max}_{i}\lambda_{v,i} and λmin=miniλv,i\lambda_{min}={min}_{i}\lambda_{v,i}. The eigenvalues of KvK_v that is not positive definite are replaced by λv,i+\lambda_{v,i}+epsilon, with espilon=λmax×=\lambda_{max}\timestol. The value of tol depends on the type of the kernel and it is chosen small.

Value

List of two components "names.Grp" and "kv":

names.Grp

Vector of size vMax, indicates the name of groups included in the meta model.

kv

List of vMax components with the same names as the vector names.Grp. Each element of the list is a list of two components "Evalues" and "Q":

Evalues

Vector of size nn, eigenvalues of each Gram matrix KvK_v.

Q

Matrix with nn rows and nn columns, eigenvectors of each Gram matrix KvK_v.

Note

Note.

Author(s)

Halaleh Kamari

References

Kamari, H., Huet, S. and Taupin, M.-L. (2019) RKHSMetaMod : An R package to estimate the Hoeffding decomposition of an unknown function by solving RKHS Ridge Group Sparse optimization problem. <arXiv:1905.13695>

See Also

RKHSMetaMod

Examples

d <- 3
n <- 50
library(lhs)
X <- maximinLHS(n, d)
c <- c(0.2,0.6,0.8)
F <- 1;for (a in 1:d) F <- F*(abs(4*X[,a]-2)+c[a])/(1+c[a])
epsilon <- rnorm(n,0,1);sigma <- 0.2
Y <- F + sigma*epsilon
Dmax <- 3
kernel <- "matern"
Kv <- calc_Kv(X, kernel, Dmax)
names <- Kv$names.Grp
Eigen.val1 <- Kv$kv$v1.$Evalues
Eigen.vec1 <- Kv$kv$v1.$Q

[Package RKHSMetaMod version 1.1 Index]