Learn R Programming

geospt (version 0.4-9)

rbf: gaussian, exponential, trigonometric, thin plate spline, inverse multiquadratic, and multiquadratic radial basis function prediction

Description

Function for gaussian (GAU), exponential (EXP), trigonometric (TRI), thin plate spline (TPS), inverse multiquadratic (IM), and multiquadratic (M) radial basis function (rbf), where rbf is in a local neighbourhood

Usage

rbf(sigma, z, coordinates, newdata, n.neigh, func)

Arguments

Value

Attributes columns contain coordinates and predictions, and the variance column contains NA's

Details

rbf function generates individual predictions from gaussian (GAU), exponential (EXP), trigonometric (TRI) thin plate spline (TPS), inverse multiquadratic (IM), and multiquadratic (M) functions

Examples

Run this code
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