areal_spacetime_bisquare {stcos} | R Documentation |
Areal Space-Time Bisquare Basis
Description
Space-Time bisquare basis on areal data.
Usage
areal_spacetime_bisquare(dom, period, knots, w_s, w_t, control = NULL)
Arguments
dom |
An |
period |
A numeric vector of time periods |
knots |
Spatio-temporal knots
|
w_s |
Spatial radius for the basis. |
w_t |
Temporal radius for the basis. |
control |
A |
Details
Notes about arguments:
-
knots
may be provided as either ansf
orsfc
object, or as a matrix of points. If an
sf
orsfc
object is provided forknots
,three-dimensional
POINT
entries are expected inst_geometry(knots)
. Otherwise,knots
will be interpreted as annumeric matrix.
If
knots
is ansf
orsfc
object, it is checked to ensure the coordinate system matchesdom
.
For each area in the given domain, and time period
compute the basis
functions
for . Here,
represent spacetime_bisquare basis functions defined at the point
level using
,
,
, and
.
The basis requires an integration which may be computed using one
of two methods. The mc
method uses a Monte Carlo approximation
based on a random sample of locations from
a uniform distribution on area
. The
rect
method uses
a simple quadrature approximation
Here, the bounding box st_bbox(A)
is divided evenly into a grid of
rectangles, each of size
.
Each
is a point from the
th
rectangle, for
and
.
Due to the treatment of and
as objects in a
Euclidean space, this basis is more suitable for coordinates from a map
projection than coordinates based on a globe representation.
The control
argument is a list which may provide any of the following:
-
method
specifies computation method:mc
orrect
. Default ismc
. -
mc_reps
is number of repetitions to use formc
. Default is 1000. -
nx
is number of x-axis points to use forrect
method. Default is 50. -
ny
is number of y-axis points to use forrect
method. Default is 50. -
report_period
is an integer; print a message with progress each time this many areas are processed. Default isInf
so that message is suppressed. -
verbose
is a logical; ifTRUE
print descriptive messages about the computation. Default isFALSE
. -
mc_sampling_factor
is a positive number; an oversampling factor used to computeblocksize
in the rdomain function. I.e.,blocksize = ceiling(mc_sampling_factor * mc_reps)
. Default is 1.2.
Value
A sparse matrix whose
th row
is
See Also
Other bisquare:
areal_spatial_bisquare()
,
spacetime_bisquare()
,
spatial_bisquare()
Examples
set.seed(1234)
# Create knot points
seq_x = seq(0, 1, length.out = 3)
seq_y = seq(0, 1, length.out = 3)
seq_t = seq(0, 1, length.out = 3)
knots = expand.grid(x = seq_x, y = seq_y, t = seq_t)
knots_sf = st_as_sf(knots, coords = c("x","y","t"), crs = NA, dim = "XYM", agr = "constant")
# Create a simple domain (of rectangles) to evaluate
shape1 = matrix(c(0.0,0.0, 0.5,0.0, 0.5,0.5, 0.0,0.5, 0.0,0.0), ncol=2, byrow=TRUE)
shape2 = shape1 + cbind(rep(0.5,5), rep(0.0,5))
shape3 = shape1 + cbind(rep(0.0,5), rep(0.5,5))
shape4 = shape1 + cbind(rep(0.5,5), rep(0.5,5))
sfc = st_sfc(
st_polygon(list(shape1)),
st_polygon(list(shape2)),
st_polygon(list(shape3)),
st_polygon(list(shape4))
)
dom = st_sf(data.frame(geoid = 1:length(sfc), geom = sfc))
rad = 0.5
period = c(0.4, 0.7)
areal_spacetime_bisquare(dom, period, knots, w = rad, w_t = 1)
areal_spacetime_bisquare(dom, period, knots_sf, w_s = rad, w_t = 1)
# Plot the (spatial) knots and the (spatial) domain at which we evaluated
# the basis.
plot(knots[,1], knots[,2], pch = 4, cex = 1.5, col = "red")
plot(dom[,1], col = NA, add = TRUE)
# Draw a circle representing the basis' radius around one of the knot points
tseq = seq(0, 2*pi, length=100)
coords = cbind(rad * cos(tseq) + seq_x[2], rad * sin(tseq) + seq_y[2])
lines(coords, col = "red")