| loo | R Documentation |
Calculation of the leave-one-out prediction, standard deviation and confidence intervals of a gekm object.
## S3 method for class 'gekm'
loo(object, reestim = TRUE, sd.fit = TRUE, scale = FALSE,
df = NULL, interval = c("none", "confidence"), level = 0.95, ...)
object |
an object of class |
reestim |
|
sd.fit |
|
scale |
|
df |
degrees of freedom for the |
interval |
a |
level |
confidence level for calculating confidence intervals. Default is |
... |
further arguments, currently not used. |
For reestim = TRUE (default), the formulas form Dubrule (1983) are used.
These enable a faster calculation of the leave-one-out prediction and the associated standard deviation, especially for a large number of observations.
However, with few observations, the re-estimated regression coefficients may differ considerably from those based on the entire data set.
Note that the process variance and correlation parameters are not re-estimated.
The loo method of class "gekm" returns a vector of leave-one-out predictions, if sd.fit = FALSE and interval = "none".
As with predict.gekm, setting sd.fit = FALSE and interval = "confidence" generates a matrix with the leave-one-out predicted values and the lower and upper limits of the confidence intervals.
For sd.fit = TRUE, a list with the following components is returned:
fit.loo |
either a |
sd.loo |
leave-one-out predicted standard deviation. |
Carmen van Meegen
Bachoc, F. (2013). Cross Validation and Maximum Likelihood Estimations of Hyper-parameters of Gaussian Processes with Model Misspecification. Computational Statistics and Data Analysis, 66:55–69. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.csda.2013.03.016")}.
Dubrule, O. (1983). Cross Validation of Kriging in a Unique Neighborhood. Mathematical Geology, 15:687–699. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/BF01033232")}.
Martin, J. D. and Simpson, T. W. (2005). Use of Kriging Models to Approximate Deterministic Computer Models. AIAA Journal, 43(4):853–863. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.2514/1.8650")}.
gekm for fitting a (gradient-enhanced) Kriging model.
predict.gekm for prediction at new data points based on a model of class "gekm".
plot.gekm for plotting the results of a leave-one-out cross-validation.
## 1-dimensional example: Oakley and O’Hagan (2002)
# Define test function and its gradient
f <- function(x) 5 + x + cos(x)
fGrad <- function(x) 1 - sin(x)
# Generate coordinates and calculate slopes
x <- seq(-5, 5, length = 5)
y <- f(x)
dy <- fGrad(x)
dat <- data.frame(x, y)
deri <- data.frame(x = dy)
# Fit gradient-enhanced Kriging model
gekm.1d <- gekm(y ~ x, data = dat, deriv = deri, covtype = "gaussian", theta = 1)
# Perform leave-one-out cross-validation
loo(gekm.1d)
loo(gekm.1d, sd.fit = FALSE)
loo(gekm.1d, sd.fit = FALSE, reestim = FALSE)
loo(gekm.1d, sd.fit = TRUE, scale = TRUE)
loo(gekm.1d, sd.fit = TRUE, reestim = FALSE, scale = TRUE)
loo(gekm.1d, sd.fit = FALSE, interval = "confidence")
loo(gekm.1d, sd.fit = TRUE, interval = "confidence")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.