Kriging::leaveOneOutVec

Description

Compute Leave-One-Out (LOO) errors vector for an object "Kriging" representing a kriging model.

Usage

  • Python

    # k = Kriging(...)
    k.leaveOneOutVec(theta)
    
  • R

    # k = Kriging(...)
    k$leaveOneOutVec(theta)
    
  • Matlab/Octave

    % k = Kriging(...)
    k.leaveOneOutVec(theta)
    
  • Julia

    # k = Kriging(...)
    result = leaveOneOutVec(k, theta)
    

Arguments

Argument

Description

theta

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

Details

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

Value

The leave-One-Out vector (mean and standard deviation) computed for the given vector \(theta\) of correlation ranges.

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)

k$leaveOneOutVec(k$theta())

Results

* data: 10x[0.0455565,0.940467] -> 10x[0.194057,1.00912]
* trend constant (est.): 0.40591
* variance (est.): 0.11868
* covariance:
  * kernel: matern3_2
  * range (est.): 0.285399
  * fit:
    * objective: LOO
    * optim: BFGS
$mean
           [,1]
 [1,] 0.9049813
 [2,] 0.4485239
 [3,] 0.9575164
 [4,] 0.3603282
 [5,] 0.2557050
 [6,] 0.4789791
 [7,] 0.6582197
 [8,] 0.3363589
 [9,] 0.6032985
[10,] 0.9246048

$stdev
             [,1]
 [1,] 0.140340658
 [2,] 0.100019973
 [3,] 0.050470594
 [4,] 0.009568305
 [5,] 0.055072495
 [6,] 0.296922066
 [7,] 0.023789948
 [8,] 0.008815353
 [9,] 0.029942501
[10,] 0.037850894