crossValTx: Prediction variances by cross-validation

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/qsOpt.R

Description

The function estimates the prediction variances by a cross-validation approach (see vignette) applied to each sample means of summary statistics.

Usage

1
2
crossValTx(qsd, cvm, theta = NULL, type = c("rmsd", "msd", "cve",
  "scve", "acve", "mse", "ascve", "sigK"), cl = NULL)

Arguments

qsd

object of class QLmodel

cvm

list of prefitted covariance models obtained from function prefitCV

theta

optional, default NULL, list or matrix of points where to estimate prediction variances

type

name of type of prediction variance

cl

cluster object, NULL (default), of class MPIcluster, SOCKcluster, cluster

Details

Other than the kriging prediction variance, which solely depends on interdistances of sample points and estimated covariance parameters of some assumed to be known spatial covariance model, the cross-validation based approach (see [4] and the vignette) even takes into account the predicted values at 'theta' and thus can be thought of a more robust measure of variability between different spatial locations. By default, 'theta' equals the current sampling set stored in the object 'qsd'.

If we set the type of measure 'type' equal to "cve", the impact on the level of accuracy (predicting at unsampled points) is measured by a delete-k jackknifed variance of prediction errors. This approach does not require further simulation runs as a measure of uncertainty for predicting the sample means of statistics at new candidate points accross the parameter space. If attr(cvm,"type") equals "max", then the maximum of kriging and CV-based prediction variances is returned.

In addition, other measures of prediction uncertainty are available such as the root mean square deviation (rmsd) and mean square deviation (msd) or the standardized cross-validation error (scve). The details are explained in the vignette. In order to assess the predictive quality of possibly different covariance models (also depending on the initial sample size), including the comparison of different sizes of initial sampling designs, the following measures [8] are available for covariance model validation and adapted to the cross-validation approach here by using an average cross-validation error (acve), the mean square error (mse) or the average standardized cross-validation error (ascve). These last measures can only be computed in case the total number of sample points equals the number of leave-one-out covariance models. This requires to fit each cross-validation covariance model by prefitCV using the option 'reduce'=FALSE which is then based on exactly one left-out point. Also, we can calculate the kriging variance at the left-out sample points if we set the option 'type' equal to "sigK".

Value

A matrix of estimated prediction variances for each point given by the argument theta (as rows) and for each statistic (as columns).

Author(s)

M. Baaske

See Also

prefitCV

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
data(normal)

# design matrix and statistics
X <- as.matrix(qsd$qldata[,1:2])
Tstat <- qsd$qldata[grep("^mean[.]",names(qsd$qldata))]

# construct but do not re-estimate
# covariance parameters by REML for CV models
qsd$cv.fit <- FALSE
cvm <- prefitCV(qsd)
theta0 <- c("mu"=2,"sd"=1)

# get mean squared deviation using cross-validation at theta0 
crossValTx(qsd, cvm, theta0, type = "msd")

# and kriging variance  
varKM(qsd$covT,theta0,X,Tstat) 	 

qle documentation built on May 2, 2019, 9:55 a.m.