idwST.tcv {geosptdb} | R Documentation |
table of idw spatio-temporal leave-one-out cross validation
Description
Generates a table with the results of inverse distance weighting spatio-temporal interpolation (idwST) from leave-one-out cross validation method.
Usage
idwST.tcv(formula, data, n.neigh, C, factor.p, progress)
Arguments
formula |
formula that defines a detrended linear model, use |
data |
SpatialPointsDataFrame: should contain the spatio-temporal dependent variable, independent variables (statics and/or dynamics), spatial coordinates and the time as an integer or numerical variable. |
n.neigh |
number of nearest observations that should be used for a idwST prediction where nearest is defined in terms of the spatio-temporal locations |
C |
numeric; associated to time factor, we recommend using the parameter found by
minimizing the root-mean-square prediction errors using cross-validation. Using idwST.cv and |
factor.p |
numeric; specify the inverse distance weighting power (p is the exponent that influences the weighting or optimal smoothing parameter) |
progress |
whether a progress bar shall be printed for spatio-temporal inverse-distance weighted function; default=TRUE |
Details
Leave-one-out cross validation (LOOCV) consists of removing data, one at a time, and then trying to predict it. Next, the predicted value can be compared to the actual (observed) value to assess how well the prediction is working. The observed value is left out because idwST would otherwise predict the value itself.
Value
data frame contain prediction columns, observed values, residuals, the prediction variance, zscore (residual divided by standard error) which left with NA's, the fold column which is associated to cross-validation count, coordinates data and time. Prediction columns and residuals are obtained from cross-validation data points.
See Also
Examples
## Not run:
data(croatiadb)
coordinates(croatiadb) <- ~x+y
idw.t <- idwST.tcv(MTEMP~1, croatiadb, n.neigh=10, C=1.0054, factor.p=1.9585)
criteriaST.cv(idw.t)
## End(Not run)