View source: R/prepare.starray.R
| prepare.starray | R Documentation | 
starray for sandwich smoothprepare.starray prepares a spatio-temporal
array for the sandwich smooth.
## S3 method for class 'starray'
prepare(data, x, y, times, rs, bs, m = 2, sparse = TRUE, spdiffpen = TRUE, ...)
| 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. | 
A prepared_starray object.
Joshua French. Based off code by Luo Xiao (see 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>
bspline, radspline
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.