Description Usage Arguments Details Value Author(s) References See Also Examples
Prediction method for the "lineqGP"
S3 class.
1 2 |
object |
an object with class |
xtest |
a vector (or matrix) with the test input design. |
... |
further arguments passed to or from other methods. |
The posterior paramaters of the finite-dimensional GP with linear inequality constraints are computed. Here, ξ is a centred Gaussian vector with covariance Γ, s.t. Φ ξ = y (interpolation constraints) and lb ≤ Λ ξ ≤ ub (inequality constraints).
A "lineqGP"
object with the following elements.
Lambda |
a matrix corresponding to the linear set of inequality constraints. |
lb |
the lower bound vector of the inequalities constraints. |
ub |
the upper bound vector of the inequalities constraints. |
Phi.test |
a matrix corresponding to the hat basis functions evaluated
at |
mu |
the unconstrained GP mean predictor. |
Sigma |
the unconstrained GP prediction conditional covariance matrix. |
xi.map |
the GP maximum a posteriori (MAP) predictor given the inequality constraints. |
A. F. Lopez-Lopera.
Lopez-Lopera, A. F., Bachoc, F., Durrande, N., and Roustant, O. (2017), "Finite-dimensional Gaussian approximation with linear inequality constraints". ArXiv e-prints [link]
create.lineqGP
, augment.lineqGP
,
simulate.lineqGP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # creating the model
sigfun <- function(x) return(1/(1+exp(-7*(x-0.5))))
x <- seq(0, 1, length = 5)
y <- sigfun(x)
model <- create(class = "lineqGP", x, y, constrType = "monotonicity")
# updating and expanding the model
model$localParam$m <- 30
model$kernParam$par <- c(1, 0.2)
model <- augment(model)
# predictions from the model
xtest <- seq(0, 1, length = 100)
ytest <- sigfun(xtest)
pred <- predict(model, xtest)
plot(xtest, ytest, type = "l", lty = 2, main = "Kriging predictions")
lines(xtest, pred$Phi.test %*% pred$mu, type = "l", col = "blue")
lines(xtest, pred$Phi.test %*% pred$xi.map, type = "l", col = "red")
legend("right", c("ytest", "mean", "mode"), lty = c(2,1,1),
col = c("black", "blue", "red"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.