create.lineqAGP: Creation Method for the '"lineqAGP"' S3 Class

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

View source: R/lineqAGP.R

Description

Creation method for the "lineqAGP" S3 class.

Usage

1
2
## S3 method for class 'lineqAGP'
create(x, y, constrType)

Arguments

x

a vector or matrix with the input data. The dimensions should be indexed by columns.

y

a vector with the output data.

constrType

a character string corresponding to the type of the inequality constraint. Options: "boundedness", "monotonicity", "convexity", "linear"; Multiple constraints can be also defined, e.g. constrType = c("boundedness", "monotonicity").

Value

A list with the following elements.

x,y,constrType

see Arguments.

d

a number corresponding to the input dimension.

constrIdx

for d > 1, a integer vector with the indices of active constrained dimensions.

constrParam

constraint inequalities for each dimension.

varnoise

a scalar with noise variance.

localParam

a list with specific parameters required for "lineqAGP" models: m (number of basis functions), sampler, and samplingParams. See simulate.lineqAGP.

kernParam

a list with the kernel parameters: par (kernel parameters), type, nugget. See kernCompute

bounds

the limit values if constrType = "boundedness".

(Lambda,lb,ub)

the linear system of inequalities if constrType = "linear".

Author(s)

A. F. Lopez-Lopera.

References

Lopez-Lopera, A. F., Bachoc, F., Durrande, N., and Roustant, O. (2017), "Finite-dimensional Gaussian approximation with linear inequality constraints". ArXiv e-prints [link]

See Also

augment.lineqAGP, predict.lineqAGP, simulate.lineqAGP

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# creating the model
d <- 2
fun1 <- function(x) return(4*(x-0.5)^2)
fun2 <- function(x) return(2*x)
targetFun <- function(x) return(fun1(x[, 1]) + fun1(x[, 2])) 
xgrid <- expand.grid(seq(0, 1, 0.01), seq(0, 1, 0.01))
ygrid <- targetFun(xgrid)
xdesign <- rbind(c(0.5, 0), c(0.5, 0.5), c(0.5, 1), c(0, 0.5), c(1, 0.5))
ydesign <- targetFun(xdesign)
model <- create(class = "lineqAGP", x = xdesign, y = ydesign,
                constrType = c("convexity", "monotonicity"))
str(model)

lineqGPR documentation built on Jan. 11, 2020, 9:23 a.m.