splineBasis2D: Calculate a spline basis representation for functional data...

View source: R/univDecomp.R

splineBasis2DR Documentation

Calculate a spline basis representation for functional data on two-dimensional domains

Description

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.

Usage

splineBasis2D(funDataObject, bs = "ps", m = NA, k = -1)

splineBasis2Dpen(funDataObject, bs = "ps", m = NA, k = -1, parallel = FALSE)

Arguments

funDataObject

An object of class funData containing the observed functional data samples and for which the basis representation is calculated.

bs

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.

m

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.

k

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.

parallel

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.

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.

Value

scores

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.

B

A matrix containing the scalar product of all pairs of basis functions.

ortho

Logical, set to FALSE, as basis functions are not orthonormal.

functions

NULL, as basis functions are known.

settings

A list with entries bs, m and k, giving the actual parameters used for generating the spline basis functions.

See Also

univDecomp, splineBasis1D, gam, bam, foreach


MFPCA documentation built on Sept. 15, 2022, 9:07 a.m.