idw.cv {geospt} | R Documentation |
idw cross validation leave-one-out
Description
Generate the RMSPE value, which is given by the idw function
with p
smoothing parameter.
Usage
idw.cv(formula, locations, data, nmax = Inf, nmin = 0, p = 2, progress=FALSE, ...)
Arguments
formula |
formula that defines the dependent variable as a linear model of independent variables; suppose the dependent variable has name z, for a idw detrended use z~1 |
data |
SpatialPointsDataFrame: should contain the dependent variable, independent variables, and coordinates. |
locations |
object of class Spatial, or (deprecated) formula defines the spatial data locations (coordinates) such as ~x+y |
nmax |
number of nearest observations that should be used for a idw prediction, where nearest is defined in terms of the spatial locations. By default, all observations are used. |
nmin |
if the number of nearest observations within distance maxdist is less than nmin, a missing value will be generated; see maxdist. |
p |
value of smoothing parameter; we recommend using the parameter found by minimizing the root-mean-square prediction errors using cross-validation. Default is 2. |
progress |
logical. Use TRUE to see the percentage of progress of the process and FALSE otherwise). Default progress=FALSE. |
... |
Other arguments passed to idw |
Value
returns the RMSPE value
See Also
Examples
data(preci)
idw.cv(prec~1, ~x+y, preci, nmax=9, nmin=9, p=2, progress=TRUE)