prepare.starray {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 'starray'
prepare(data, x, y, times, rs, bs, m = 2, sparse = TRUE, spdiffpen = TRUE, ...)
Arguments
data |
An |
x |
A vector or matrix of x coordinates. See Details. |
y |
A vector or matrix of y coordinates. See Details. |
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_starray
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)
data = starray(tasmax)
p = prepare(data, x = lon, y = lat, times = 1:30,
rs = rs, bs = bs)