slp
is based on .dpss
, which generates a family of Discrete
Prolate Spheroidal (Slepian) Sequences. These vectors are orthonormal, have alternating
even/odd parity, and form the optimally concentrated basis set for the subspace of
R^N
corresponding to the bandwidth W
. Full details are given
in Slepian (1978). These basis functions have natural boundary conditions, and lack any form of
knot structure. This version is returned for naive = TRUE
. The dpss
basis vectors can be adapted to provide the additional
useful property of capturing or passing constants perfectly. That is, the smoother matrix
S
formed from the returned rectangular matrix will either reproduce constants
at near round-off precision, i.e., S %*% rep(1, N) = rep(1, N)
,
for naive = FALSE
with intercept = TRUE
, or will pass constants,
i.e., S %*% rep(1, N) = rep(0, N)
, for naive = FALSE
with intercept = FALSE
.
The primary use is in modeling formula to directly specify a Slepian time-based smoothing
term in a model: see the examples.
For large N
this routine can be very slow. If you are computing models with
large N
, we highly recommend pre-computing the basis object, then using it
in your models without recomputation. The third example below demonstrates this approach.