View source: R/helper_functions.R
splineBasis | R Documentation |
Following Wand and Ormerod (2008), compute a low-rank thin plate spline basis which is diagnalized such that the prior variance for the nonlinear component is a scalar times a diagonal matrix. Knot locations are determined by quantiles and the penalty is the integrated squared second derivative.
splineBasis(tau, sumToZero = TRUE, rescale01 = TRUE)
tau |
|
sumToZero |
logical; if TRUE, enforce a sum-to-zero constraint (useful for additive models) |
rescale01 |
logical; if TRUE, rescale |
B_nl
: the nonlinear component of the spline basis matrix
To form the full spline basis matrix, compute cbind(1, tau, B_nl)
.
The sum-to-zero constraint implicitly assumes that the linear term is
centered and scaled, i.e., scale(tau)
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.