eFun function

Generate orthonormal eigenfunctions

Generate orthonormal eigenfunctions

This function calculates MM (orthonormal) basis functions on a given interval, that can be interpreted as the first MM eigenfunctions of an appropriate data generating process of functional data.

eFun(argvals, M, ignoreDeg = NULL, type)

Arguments

  • argvals: A vector of numerics, defining a (fine) grid on the interval for which the basis functions are computed.
  • M: An integer, specifying the number of functions that are calculated.
  • ignoreDeg: A vector of numerics, specifying the degrees to be ignored for type "PolyHigh". Defaults to NULL. See Details.
  • type: A character string, specifying the type of functions that are calculated. See Details.

Returns

A univariate functional data object of class funData containing the basis functions on the given interval.

Details

The function implements three families of orthonormal basis functions plus variations of them. The parameter type, that specifies the functions to be calculated, can have the following values:

  • "Poly": Calculate orthonormal Legendre polynomials of degree 0,...,M-1.

  • "PolyHigh": Calculate MM orthonormal Legendre Polynomials of higher degree. The vector of indices ignoreDeg

    specifies the functions to be ignored. If ignoreDeg is not specified, the function returns an error.

  • "Fourier": Calculate the first MM Fourier basis functions.

  • "FourierLin": Calculate the first M1M-1 Fourier basis functions plus the linear function, orthonormalized to the previous functions via Gram-Schmidts method. This type is currently implemented for functions on the unit interval [0,1][0,1] only. If the function is called with other argvals, an error is thrown.

  • "Wiener": Calculate the first MM orthonormal eigenfunctions of the Wiener process.

Examples

oldPar <- par(no.readonly = TRUE) argvals <- seq(0,1,0.01) par(mfrow = c(3,2)) plot(eFun(argvals, M = 4, type = "Poly"), main = "Poly", ylim = c(-3,3)) plot(eFun(argvals, M = 4, ignoreDeg = 1:2, type = "PolyHigh"), main = "PolyHigh", ylim = c(-3,3)) plot(eFun(argvals, M = 4, type = "Fourier"), main = "Fourier", ylim = c(-3,3)) plot(eFun(argvals, M = 4, type = "FourierLin"), main = "FourierLin", ylim = c(-3,3)) plot(eFun(argvals, M = 4, type = "Wiener"), main = "Wiener", ylim = c(-3,3)) par(oldPar)

See Also

funData, simFunData, simMultiFunData