fun_MA: Simulate Functional Moving Average Process

Description Usage Arguments Details Value References See Also Examples

View source: R/fun_MA.R

Description

It generates functional Moving Average, FMA, process of sample size n with a specific number of basis functions where the eigenvalue decay of the covariance operator is given by the defined vector Sigma. The norm of the functional moving average operators are defined by the vector kappa. The generic function uses Fourier basis in [0,1], however one can define a different basis and different range values. If the order or kappa is not defined then the function generates iid functional data by default.

Usage

1
2
fun_MA(n, nbasis, order = NULL, kappa = NULL, Sigma = NULL,
  basis = NULL, rangeval = c(0, 1), ...)

Arguments

n

Sample size of generated functional data. A strictly positive integer

nbasis

Number of basis functions used to represent functional observations

order

Order of the FMA process

kappa

Vector of norm of the FMA operators. The length of this vector must be same as the FMA order

Sigma

Eigen value decay of the covariance operator of the functional data. The eigenvalues of the covariance operator of the generated functional sample will mimic the behavior of Sigma. The length of Sigma must match number of basis. By default it is set as (1:nbasis)^-1

basis

A functional basis object defining the basis. It can be the class of basisfd, fd, fdPar. As a default it is set to be a Fourier basis

rangeval

A vector of length 2 containing the initial and final values of the interval over which the functional data object can be evaluated. As a default it is set to be [0,1].

...

Further arguments to pass

Details

This function should be used for a simple functional moving average data generation for a desired eigenvalue decay of covariance operator. The j-th FMA operator Θ[j] is generated by Θ[j] = κ[j]Θ, where Θ has a unit norm with Θ[i,j] = N(0, σ[i]σ[j]). For more details see Aue A., Rice G., Sonmez O. (2017+).

Value

Functional Moving Average data sample (class fd) containing:

coefs

The coefficient array

basis

A basis object

fdnames

A list containing names for the arguments, function values and variables

References

Ramsay, James O., and Silverman, Bernard W. (2006), Functional Data Analysis, 2nd ed., Springer, New York.

Aue A., Rice G., Sonmez O. (2017+), Detecting and dating structural breaks in functional data without dimension reduction (https://arxiv.org/pdf/1511.04020.pdf)

See Also

Data2fd, fun_IID

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# FMA(1) data with 21 fourier basis with a geometric eigenvalue decay
fun_MA(n=100, nbasis=21, order=1, kappa=0.8)


# Define eigenvalue decay
Sigma1 = 2^-(1:21)
# Then generate FMA(2) data
fun_MA(n=100, nbasis=21, order=2, kappa= c(0.5, 0.3), Sigma=Sigma1)

# Define eigenvalue decay, and basis function
library(fda)
basis1 = create.bspline.basis(rangeval = c(0,1), nbasis=21)
Sigma1 = 2^-(1:21)
# Then generate FMA(1)
fun_MA(n=100, nbasis=21, order=1, kappa= 0.3,Sigma=Sigma1, basis=basis1)

# Not defining order will result in generating IID functions
fun_MA(n=100, nbasis=21) # same as fun_IID(n=100, nbasis=21)

SonmezOzan/fChange_0.2.0 documentation built on May 17, 2019, 8:04 a.m.