univDecomp function

Univariate basis decomposition

Univariate basis decomposition

This function calculates a univariate basis decomposition for a (univariate) functional data object.

univDecomp(type, funDataObject, ...)

Arguments

  • type: A character string, specifying the basis for which the decomposition is to be calculated.
  • funDataObject: A funData object, representing the (univariate) functional data samples.
  • ...: Further parameters, passed to the function for the particular basis to use.

Returns

  • scores: A matrix of scores (coefficients) for each observation based on the prespecified basis functions. - B: A matrix containing the scalar products of the basis functions. Can be NULL if the basis functions are orthonormal.

  • ortho: Logical. If TRUE, the basis functions are all orthonormal. - functions: A functional data object, representing the basis functions. Can be NULL if the basis functions are not estimated from the data, but have a predefined form. See Details.

Details

Functional data Xi(t)X_i(t) can often be approximated by a linear combination of basis functions bk(t)b_k(t)

Xi(t)=k=1Kθikbk(t),i=1,,N. X_i(t) = \sum_{k =1}^K \theta_{ik} b_k(t), i = 1, \ldots, N.

The basis functions may be prespecified (such as spline basis functions or Fourier bases) or can be estimated from the data (e.g. by functional principal component analysis) and are the same for all observations c("X1(t),ldots,\nX_1(t), \\ldots,\n", "Xn(t)X_n(t)"). The coefficients (or scores) θik\theta_{ik} reflect the weight of each basis function bk(t)b_k(t) for the observed function Xi(t)X_i(t) and can be used to characterize the individual observations.

Warning

The options type = "DCT2D" and type = "DCT3D" have not been tested with ATLAS/MKL/OpenBLAS.

Examples

# generate some data dat <- simFunData(argvals = seq(0,1,0.01), M = 5, eFunType = "Poly", eValType = "linear", N = 100)$simData # decompose the data in univariate functional principal components... decFPCA <- univDecomp(type = "uFPCA", funDataObject = dat, npc = 5) str(decFPCA) # or in splines (penalized) decSplines <- univDecomp(type = "splines1Dpen", funDataObject = dat) # use mgcv's default params str(decSplines)

See Also

MFPCA, univExpansion, fpcaBasis, splineBasis1D, splineBasis1Dpen, splineBasis2D, splineBasis2Dpen, umpcaBasis, fcptpaBasis, fdaBasis, dctBasis2D, dctBasis3D