eval_basis | R Documentation |
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)
basis |
object of class |
s |
object of class |
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.
auto_basis
for automatically constructing basis functions.
library(sp)
### Create a synthetic dataset
set.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 sphere
G <- auto_basis(manifold = sphere(),data=d,
nres = 2,prune=15,
type = "bisquare",
subsamp = 20000)
### Now evaluate basis functions at origin
S <- eval_basis(G,matrix(c(0,0),1,2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.