fun_IID: Simulate Independent Functional Data

Description Usage Arguments Details Value References See Also Examples

View source: R/fun_IID.R

Description

This function generates independent functional observations of sample size n with a desired eigenvalue decay structure of the covariance operator.

Usage

1
fun_IID(n, nbasis, 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

Sigma

Eigen value decay of the covariance operator of the functional data. The eigenvalues of the covariance operator of the generated functional sample are given by 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

Independent functional sample is generated based on a linear combination of basis functions where the i-th linear combination coefficient is normally distributed with mean zero and standard deviation σ[i].

Value

An independent functional 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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# Functional data with 21 fourier basis with a geometric eigenvalue decay
fun_IID(n=100, nbasis=21)

# Define eigenvalue decay
Sigma1=2^-(1:21)
# Then generate functional data
fun_IID(n=100, nbasis=21, 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 functional data
fun_IID(n=100, nbasis=21, Sigma=Sigma1, basis=basis1)

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