data(preci)
# prediction case: a point
point <- matrix(c(3,4),nrow=1)
rbf(sigma=0.1460814, z=preci$prec, coordinates=preci[,2:3], newdata=point,
n.neigh=10, func="TPS")
# prediction case: a grid of points
puntos<-expand.grid(x=seq(min(preci$x),max(preci$x),0.02), y=seq(min(preci$y),
max(preci$y),0.02))
pred.rbf <- rbf(sigma=0.1460814, z=preci$prec, coordinates=preci[,2:3],
newdata=puntos, n.neigh=10, func="TPS")
coordinates(pred.rbf) = c("x", "y")
gridded(pred.rbf) <- TRUE
# show prediction map
spplot(pred.rbf["var1.pred"], cuts=40, col.regions=bpy.colors(100),
main = "rainfall map TPS", key.space=list(space="right", cex=0.8))Run the code above in your browser using DataLab