assemble {hero} | R Documentation |
Assemble spline ingredients for sandwich smooth
Description
Assemble computations from a spline-related object
x
in order to implement the sandwich smoother.
This is essentially an internal function, but could be
useful for performing a manual implementation of the
sandwich smoother.
Usage
assemble(object, ...)
## S3 method for class 'hero_bspline'
assemble(object, x, m = 2, sparse = TRUE, ...)
## S3 method for class 'hero_radspline'
assemble(object, x, m = 2, sparse = TRUE, spdiffpen = TRUE, digits = 1, ...)
## S3 method for class 'list'
assemble(object, x, m = 2, sparse = TRUE, spdiffpen = TRUE, digits = 1, ...)
Arguments
object |
A spline-related object (e.g, a
|
... |
Not implemented |
x |
Values at which to evaluate the basis functions.
This
should be a numeric vector if |
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
|
digits |
The number of digits to use when applying
|
Value
A list with the necessary components (ingredients)
Examples
# construct b-spline
object1 = bspline(nbasis = 10)
# sequence to evaluate
x1 = seq(0, 1, len = 11)
# assemble b-spline information
spline1 = assemble(object1, x1)
# assemble radial spline information
border = border.grid(lon, lat)
object2 = radspline(nknots = 16, border)
x2 = cbind(c(lon), c(lat))
spline2 = assemble(object2, x = x2)
# assemble for list of splines
object = list(object1, object2)
x = list(x1, x2)
splines = assemble(object, x)