leaveOneOutVec.Kriging: Compute Leave-One-Out (LOO) vector error for an object with...

View source: R/KrigingClass.R

leaveOneOutVec.KrigingR Documentation

Compute Leave-One-Out (LOO) vector error for an object with S3 class "Kriging" representing a kriging model.

Description

The returned value is the mean and stdev of \hat{y}_{i,(-i)}, the prediction of y_i based on the the observations y_j with j \neq i.

Usage

## S3 method for class 'Kriging'
leaveOneOutVec(object, theta, ...)

Arguments

object

A Kriging object.

theta

A numeric vector of range parameters at which the LOO will be evaluated.

...

Not used.

Value

The leave-One-Out vector computed for the given vector \boldsymbol{\theta} of correlation ranges.

Author(s)

Yann Richet yann.richet@irsn.fr

Examples

f <- function(x) 1 - 1 / 2 * (sin(12 * x) / (1 + x) + 2 * cos(7 * x) * x^5 + 0.7)
set.seed(123)
X <- as.matrix(runif(10))
y <- f(X)

k <- Kriging(y, X, kernel = "matern3_2", objective = "LOO", optim="BFGS")
print(k)

leaveOneOutVec(k, k$theta())

rlibkriging documentation built on July 9, 2023, 5:53 p.m.