rbfST | R Documentation |
Function for spatio-temporal interpolation from radial basis function (rbfST), where rbfST is in a local neighbourhood.
exponential (EXPON)
φ(δ)=e^{-η δ}, η>0
gaussiano (GAU)
φ(δ)=e^{-η δ^{2}}, η\neq0
multiquadratic (M)
φ(δ)=√{η^2+δ^2}, η\neq0
inverse multiquadratic (IM)
φ(δ)=1/√{η^2+δ^2}, η\neq0
thin plate spline (TPS)
φ(δ)=(η\cdotδ)^{2}log(η\cdotδ), if: δ>0, η>0
φ(δ) = 0, otherwise
completely regularized spline (CRS)
φ(δ) = \ln(η\cdot δ/2)^{2}+E_{1}(η\cdot δ/2)^{2}+C_{E}, if: δ>0, η>0
φ(δ) = 0, otherwise
where \ln is natural logarithm, E_{1}(x) is the exponential integral function, and C_{E} is the Euler constant.
spline with tension (ST)
φ(δ)=\ln(η\cdot δ/2)+K_{0}(η\cdot δ)+C_{E}, if: δ>0
φ(δ) = 0, otherwise
where K_{0}(x) is the modified Bessel function and C_{E} is the Euler constant.
rbfST(formula, data, eta, rho, newdata, n.neigh, func, progress)
formula |
formula that defines the dependent variable as a linear model of independent variables (covariates or principal coordinates); suppose the dependent variable has name z_{st} for a rbfST detrended use z_{st} |
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. |
eta |
the optimal smoothing parameter, we recommend using the parameter found by minimizing the root-mean-square prediction errors using cross-validation |
rho |
optimal robustness parameter, we recommend using the value obtained by minimizing the root-mean-square prediction errors with cross-validation. eta and rho parameters can be optimized simultaneously, through the |
newdata |
data frame or spatial object with prediction/simulation spatio-temporal locations; should contain attribute columns with the independent variables (if present) and (if locations is a formula) the coordinates and time with names, as defined in locations where you want to generate new predictions |
n.neigh |
number of nearest observations that should be used for a rbfST prediction, where nearest is defined in terms of the spatio-temporal locations |
func |
spatio-temporal radial basis function; model type: "GAU", "EXPON", "TRI", "TPS", "CRS", "ST", "IM" and "M", are currently available |
progress |
whether a progress bar shall be printed for spatio-temporal radial basis functions; default=TRUE |
rbf.st function generates individual spatio-temporal predictions from gaussian (GAU), exponential (EXPON), trigonometric (TRI) thin plate spline (TPS), completely regularized spline (CRS), spline with tension (ST), inverse multiquadratic (IM), and multiquadratic (M) functions
Attributes columns contain coordinates, time, predictions, and the variance column contains NA's
Melo, C. E. (2012). Analisis geoestadistico espacio tiempo basado en distancias y splines con aplicaciones. PhD. Thesis. Universitat de Barcelona. 276 p. [link]
## Not run: # considering 10 principal coordinates (constructed from a distance-based regression model) data(croatia.temp) data(croatiadb) # prediction case: one point point <- data.frame(670863,5043464,5,170,200,15.7,3) names(point) <- c("x","y","t","dem","dsea","twi","est") croatia.temp[,7] <- as.factor(croatia.temp[,7]) dblm1 <- dblm(data=croatia.temp,y=croatiadb$MTEMP) newdata1 <- t(cp.xnews(newdata=point,eigenvalues=dblm1$ev, data=croatia.temp,trend=dblm1$cp)) colnames(newdata1) <- c("X1","X2","X3","X4","X5","X6","X7","X8","X9","X10") newdata1 <- data.frame(point[,1:3],newdata1) data(croatiadb) coordinates(croatiadb) <- ~x+y coordinates(newdata1) <- ~x+y rbfST(MTEMP~X1+X2+X3+X4+X5+X6+X7+X8+X9+X10, data=croatiadb, eta=0.010076, rho=0.00004, newdata=newdata1, n.neigh=60, func="TPS") # prediction case: a grid of points Croatia (month july) data(croatia.grid7cp) coordinates(croatia.grid7cp) <- ~x+y rbf.t <- rbfST(MTEMP~X1+X2+X3+X4+X5+X6+X7+X8+X9+X10, croatiadb, eta=0.01076, rho=0.00004, newdata=croatia.grid7cp, n.neigh=30, func="TPS") coordinates(rbf.t) <- c("x", "y") gridded(rbf.t) <- TRUE # show prediction map spplot(rbf.t["var1.pred"], cuts=30, col.regions=bpy.colors(40), main = "Earth's average temperature TPS map\n (july month)", key.space=list(space="right", cex=0.8)) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.