Evaluate basis functions at points or average functions over polygons.
eval_basis(basis, s)## S4 method for signature 'Basis,matrix'eval_basis(basis, s)## S4 method for signature 'Basis,SpatialPointsDataFrame'eval_basis(basis, s)## S4 method for signature 'Basis,SpatialPolygonsDataFrame'eval_basis(basis, s)## S4 method for signature 'Basis,STIDF'eval_basis(basis, s)## S4 method for signature 'TensorP_Basis,matrix'eval_basis(basis, s)## S4 method for signature 'TensorP_Basis,STIDF'eval_basis(basis, s)## S4 method for signature 'TensorP_Basis,STFDF'eval_basis(basis, s)
Arguments
basis: object of class Basis
s: object of class matrix, SpatialPointsDataFrame or SpatialPolygonsDataFrame containing the spatial locations/footprints
Details
This function evaluates the basis functions at isolated points, or averages the basis functions over polygons, for computing the matrix S. The latter operation is carried out using Monte Carlo integration with 1000 samples per polygon. When using space-time basis functions, the object must contain a field t containing a numeric representation of the time, for example, containing the number of seconds, hours, or days since the first data point.
Examples
library(sp)### Create a synthetic datasetset.seed(1)d <- data.frame(lon = runif(n=500,min =-179, max =179), lat = runif(n=500,min =-90, max =90), z = rnorm(500))coordinates(d)<-~lon + lat
slot(d,"proj4string")= CRS("+proj=longlat")### Now create basis functions on sphereG <- auto_basis(manifold = sphere(),data=d, nres =2,prune=15, type ="bisquare", subsamp =20000)### Now evaluate basis functions at originS <- eval_basis(G,matrix(c(0,0),1,2))
See Also
auto_basis for automatically constructing basis functions.