Last chance! 50% off unlimited learning
Sale ends in
## S3 method for class 'Krig':
predict.se(object, x = NULL, cov = FALSE, verbose = FALSE,...)
In these calculations it is assumed that the covariance parameters are fixed. This is an approximation since in most cases they have been estimated from the data. It should also be noted that if one assumes a Gaussian field and known parameters in the covariance, the usual Kriging estimate is the conditional mean of the field given the data. This function finds the conditional standard deviations (or full covariance matrix) of the fields given the data.
There are two useful extensions supported by this function. Adding the variance to the estimate of the spatial mean if this is a correlation model. (See help file for Krig) and calculating the variances under covariance misspecification. Note that the linear combination is based on the covariance function from the Krig object. One can view this first step as simply defining a spatial estimator. If the covariance used is correct it is BLUE, otherwise the MSE for the spatial estimate will be larger than optimal. The 'cov.function' argument in this function defaults to the same covariance used to determine the spatial prediction but it also can be specified separately, in this case it is interpreted as the true covariance and the prediction variances are evaluated accordingly.
#
# Note: in these examples predict.se will default to predict.se.Krig using
# a Krig object
fit<- Krig(ozone$x,ozone$y,cov.function="Exp.cov", theta=10) # Krig fit
predict.se.Krig(fit) # std errors of predictions at obs.
# make a grid of X's
xg<-make.surface.grid(
list(East.West=seq(-27,34,,20),North.South=seq(-20,35,,20)))
out<- predict.se.Krig(fit,xg) # std errors of predictions
#at the grid points out is a vector of length 400
#reshape the grid points into a 20X20 matrix etc.
out.p<-as.surface( xg, out)
surface( out.p, type="C")
# this is equivalent to the single step function
# (but default is not to extrapolation beyond data
# out<- predict.surface.se( fit)
# image.plot( out)
Run the code above in your browser using DataLab