estimate_iid_distr_MC: Estimate distribution of the fACF under the iid. hypothesis...

Description Usage Arguments Value Examples

View source: R/estimate_distribution.R

Description

Estimate the distribution of the autocorrelation function under the hypothesis of strong functional white noise. This function uses Montecarlo's method to estimate the distribution.

Usage

1
2
estimate_iid_distr_MC(Y, v, autocovSurface, matindex, nsimul = 10000,
  figure = FALSE, ...)

Arguments

Y

Matrix containing the discretized values of the functional time series. The dimension of the matrix is (n x m), where n is the number of curves and m is the number of points observed in each curve.

v

Discretization points of the curves, by default seq(from = 0, to = 1, length.out = 100).

autocovSurface

An (m x m) matrix with the discretized values of the autocovariance operator \hat{C}_{0}, obtained by calling the function obtain_autocovariance. The value m indicates the number of points observed in each curve.

matindex

A vector containing the L2 norm of the autocovariance function. It can be obtained by calling function obtain_suface_L2_norm.

nsimul

Positive integer indicating the number of MC simulations that will be used to estimate the distribution of the statistic. Increasing the number of simulations will improve the estimation, but it will increase the computational time. By default, nsimul = 10000.

figure

Logical. If TRUE, plots the estimated distribution.

...

Further arguments passed to the plot function.

Value

Return a list with:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Example 1

N <- 100
v <- seq(from = 0, to = 1, length.out = 10)
sig <- 2
Y <- simulate_iid_brownian_bridge(N, v, sig)
nlags <- 1
autocovSurface <- obtain_autocovariance(Y,nlags)
matindex <- obtain_suface_L2_norm (v,autocovSurface)
# Remove lag 0
matindex <- matindex[-1]
MC_dist <- estimate_iid_distr_MC(Y,v,autocovSurface,matindex)
plot(MC_dist$ex,MC_dist$ef,type = "l",main = "ecdf obtained by MC simulation")
grid()


# Example 2

N <- 400
v <- seq(from = 0, to = 1, length.out = 50)
sig <- 2
Y <- simulate_iid_brownian_bridge(N, v, sig)
nlags <- 20
autocovSurface <- obtain_autocovariance(Y,nlags)
matindex <- obtain_suface_L2_norm (v,autocovSurface)
# Remove lag 0
matindex <- matindex[-1]
MC_dist <- estimate_iid_distr_MC(Y,v,autocovSurface,matindex)
plot(MC_dist$ex,MC_dist$ef,type = "l",main = "ecdf obtained by MC simulation")
grid()

fdaACF documentation built on Oct. 23, 2020, 8:05 p.m.