These functions calculate a penalized or unpenalized tensor product spline
basis representation for functional data on two-dimensional domains based on
the gam
/bam
functions in the
mgcv package. See Details.
splineBasis2D(funDataObject, bs = "ps", m = NA, k = -1)splineBasis2Dpen(funDataObject, bs = "ps", m = NA, k = -1, parallel = FALSE)
A matrix of scores (coefficients) with dimension
N x K
, reflecting the weights for each basis function in each
observation, where K
is the total number of basis functions used.
A matrix containing the scalar product of all pairs of basis functions.
Logical, set to FALSE
, as basis functions
are not orthonormal.
NULL
, as basis functions are
known.
A list with entries bs
, m
and
k
, giving the actual parameters used for generating the spline basis
functions.
An object of class funData
containing the observed functional data samples and for which the basis
representation is calculated.
A vector of character strings (or a single character string),
specifying the type of basis functions to be used. Defaults to "ps"
(P-spline functions). Please refer to te
for a list of
possible basis functions.
A numeric vector (or a single number), the order of the spline
basis. Defaults to NA
, i.e. the order is chosen automatically. See
s
for details.
An numeric vector (or a single number), the number of basis
functions used. Defaults to -1
, i.e. the number of basis functions
is chosen automatically. See s
for details.
Logical (only for function splineBasis2Dpen
). If
TRUE
, the coefficients for the basis functions are calculated in
parallel. The implementation is based on the foreach
function and requires a parallel backend that must be registered before.
See foreach
for details.
If the basis representation is calculated without penalization
(splineBasis2D
), the coefficients are computed using the
gam
function from the mgcv package. In the case of
penalization (splineBasis2Dpen
), the function bam
(for large GAMs) is used instead.