prepare.sts {hero} | R Documentation |
Prepare starray
for sandwich smooth
Description
prepare.starray
prepares a spatio-temporal
array for the sandwich smooth.
Usage
## S3 method for class 'sts'
prepare(
data,
coords,
times,
rs,
bs,
m = 2,
sparse = TRUE,
spdiffpen = TRUE,
...
)
Arguments
data |
An |
coords |
A two-dimensional matrix-like object with non-NULL dimensions. |
times |
The vector of times at which the data were observed. |
rs |
A |
bs |
A |
m |
A positive integer indicating order of the difference penalty. |
sparse |
A logical value indicating if the result
should be a sparse version of the
|
spdiffpen |
A logical value indicating whether
|
... |
Not currently implemented. |
Value
A prepared_sts
object.
Author(s)
Joshua French. Based off code by Luo Xiao (see References).
References
Xiao, L. , Li, Y. and Ruppert, D. (2013), Fast bivariate P-splines: the sandwich smoother. J. R. Stat. Soc. B, 75: 577-599. <doi:10.1111/rssb.12007>
See Also
Examples
# construct basis functions
border = border.grid(lon, lat)
rs = radspline(nknots = 36, poverlap = 3,
border = border, longlat = TRUE)
bs = bspline(c(1, 30), nbasis = 6)
splines = list(rs, bs)
data = as.sts(tasmax)
p = prepare(data, coords = cbind(c(lon), c(lat)),
times = 1:30, rs = rs, bs = bs)