R: Diagnostic plot for the validation of a km object
plot
R Documentation
Diagnostic plot for the validation of a km object
Description
Three plots are currently available, based on the leaveOneOut.km results: one plot of fitted values against response values, one plot of standardized residuals, and one qqplot of standardized residuals.
Usage
## S4 method for signature 'km'
plot(x, y, kriging.type = "UK", trend.reestim = FALSE, ...)
Arguments
x
an object of class "km" without noisy observations.
y
not used.
kriging.type
an optional character string corresponding to the kriging family, to be chosen between simple kriging ("SK") or universal kriging ("UK").
trend.reestim
should the trend be reestimated when removing an observation? Default to FALSE.
...
no other argument for this method.
Details
The diagnostic plot has not been implemented yet for noisy observations. The standardized residuals are defined by ( y(xi) - yhat_{-i}(xi) ) / sigmahat_{-i}(xi), where y(xi) is the response at the point xi, yhat_{-i}(xi) is the fitted value when removing the observation xi (see leaveOneOut.km), and sigmahat_{-i}(xi) is the corresponding kriging standard deviation.
Value
A list composed of:
mean
a vector of length n. The ith coordinate is equal to the kriging mean (including the trend) at the ith observation number when removing it from the learning set,
sd
a vector of length n. The ith coordinate is equal to the kriging standard deviation at the ith observation number when removing it from the learning set,
where n is the total number of observations.
Warning
Kriging parameters are not re-estimated when removing one observation. With few points, the re-estimated values can be far from those obtained with the entire learning set. One option is to reestimate the trend coefficients, by setting trend.reestim=TRUE.
Author(s)
O. Roustant, D. Ginsbourger, Ecole des Mines de St-Etienne.
References
N.A.C. Cressie (1993), Statistics for spatial data, Wiley series in probability and mathematical statistics.
J.D. Martin and T.W. Simpson (2005), Use of kriging models to approximate deterministic computer models, AIAA Journal, 43 no. 4, 853-863.
M. Schonlau (1997), Computer experiments and global optimization, Ph.D. thesis, University of Waterloo.
See Also
predict,km-method, leaveOneOut.km
Examples
# A 2D example - Branin-Hoo function
# a 16-points factorial design, and the corresponding response
d <- 2; n <- 16
fact.design <- expand.grid(seq(0,1,length=4), seq(0,1,length=4))
fact.design <- data.frame(fact.design); names(fact.design)<-c("x1", "x2")
branin.resp <- data.frame(branin(fact.design)); names(branin.resp) <- "y"
# kriging model 1 : gaussian covariance structure, no trend,
# no nugget effect
m1 <- km(~.^2, design=fact.design, response=branin.resp, covtype="gauss")
plot(m1) # LOO without parameter reestimation
plot(m1, trend.reestim=TRUE) # LOO with trend parameters reestimation
# (gives nearly the same result here)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(DiceKriging)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/DiceKriging/plot.km.Rd_%03d_medium.png", width=480, height=480)
> ### Name: plot
> ### Title: Diagnostic plot for the validation of a km object
> ### Aliases: plot plot.km plot,km-method
> ### Keywords: models methods
>
> ### ** Examples
>
> # A 2D example - Branin-Hoo function
>
> # a 16-points factorial design, and the corresponding response
> d <- 2; n <- 16
> fact.design <- expand.grid(seq(0,1,length=4), seq(0,1,length=4))
> fact.design <- data.frame(fact.design); names(fact.design)<-c("x1", "x2")
> branin.resp <- data.frame(branin(fact.design)); names(branin.resp) <- "y"
>
> # kriging model 1 : gaussian covariance structure, no trend,
> # no nugget effect
> m1 <- km(~.^2, design=fact.design, response=branin.resp, covtype="gauss")
optimisation start
------------------
* estimation method : MLE
* optimisation method : BFGS
* analytical gradient : used
* trend model : ~x1 + x2 + x1:x2
* covariance model :
- type : gauss
- nugget : NO
- parameters lower bounds : 1e-10 1e-10
- parameters upper bounds : 2 2
- best initial criterion value(s) : -72.48648
N = 2, M = 5 machine precision = 2.22045e-16
At X0, 0 variables are exactly at the bounds
At iterate 0 f= 72.486 |proj g|= 1.347
At iterate 1 f = 72.438 |proj g|= 0.80854
At iterate 2 f = 72.167 |proj g|= 0.76097
At iterate 3 f = 72.003 |proj g|= 0.68147
At iterate 4 f = 71.999 |proj g|= 0.30895
At iterate 5 f = 71.997 |proj g|= 0.010256
At iterate 6 f = 71.997 |proj g|= 0.00016266
At iterate 7 f = 71.997 |proj g|= 0.00015922
iterations 7
function evaluations 12
segments explored during Cauchy searches 9
BFGS updates skipped 0
active bounds at final generalized Cauchy point 1
norm of the final projected gradient 0.000159222
final function value 71.9975
F = 71.9975
final value 71.997485
converged
> plot(m1) # LOO without parameter reestimation
> plot(m1, trend.reestim=TRUE) # LOO with trend parameters reestimation
> # (gives nearly the same result here)
>
>
>
>
>
> dev.off()
null device
1
>