Learn R Programming

geosptdb (version 1.0-2)

idwST.cv1: Generate a RMSPE value, result of leave-one-out cross validation

Description

Generate the RMSPE value which is given by the radial basis function spatio-temporal with number of nearest observationsn.neigh associated to time factor C and optimal smoothing parameter factor.p.

Usage

idwST.cv1(param, formula, data, n.neigh, progress)

Value

returns the RMSPE value

Arguments

param

vector starting points (C and factor.p respectively) for searching the RMSPE optimum.

formula

formula that defines a detrended linear model, use \(z_{st}\)~1.

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 rbf.st prediction where nearest is defined in terms of the spatio-temporal locations

progress

whether a progress bar shall be printed for spatio-temporal inverse-distance weighted function; default=FALSE

See Also

idwST, idwST.cv, idwST.tcv

Examples

Run this code
require(minqa)
data(croatiadb)
coordinates(croatiadb) <- ~x+y

if (FALSE) {
idwST.opt <- bobyqa(c(1, 2), idwST.cv1, lower=c(0,0.1), upper=c(2,4), formula=MTEMP~1, 
                    data=croatiadb[,1:2], n.neigh=10, progres=F, control=list(maxfun=50))         

# obtained with optimal values previously estimated (33 iterations)
idwST.cv1(c(1.00538675066736,1.95853920335545), MTEMP~1, data=croatiadb[,1:2], n.neigh=10, 
          progress=T)
}

Run the code above in your browser using DataLab