eFun {funData} | R Documentation |
Generate orthonormal eigenfunctions
Description
This function calculates M
(orthonormal) basis functions on a given
interval, that can be interpreted as the first M
eigenfunctions of an
appropriate data generating process of functional data.
Usage
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 |
type |
A character string, specifying the type of functions that are calculated. See Details. |
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"
: CalculateM
orthonormal Legendre Polynomials of higher degree. The vector of indicesignoreDeg
specifies the functions to be ignored. IfignoreDeg
is not specified, the function returns an error. -
"Fourier"
: Calculate the firstM
Fourier basis functions. -
"FourierLin"
: Calculate the firstM-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]
only. If the function is called with otherargvals
, an error is thrown. -
"Wiener"
: Calculate the firstM
orthonormal eigenfunctions of the Wiener process.
Value
A univariate functional data object of class
funData
containing the basis functions on the given
interval.
See Also
funData
, simFunData
,
simMultiFunData
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)