EF2dfa: Expected value of the detrended variance

Description Usage Arguments Value Author(s) References Examples

View source: R/code.R

Description

Calculates the expected value of the detrended variance.

Usage

1
EF2dfa(m = 3, nu = 0, G, K = NULL)

Arguments

m

an integer or integer valued vector indicating the size of the window for the polinomial fit. min(m) must be greater or equal than nu or else it will return an error.

nu

a non-negative integer denoting the degree of the polinomial fit applied on the integrated series.

G

the autocovariance matrix for the original time series. The dimension of G must be (max(m)+1) by (max(m)+1).

K

optional: the matrix K. If this matrix is provided and m is an integer, then nu is ignored.

Value

A vector of size length(m) containing the expected values of the detrended variance corresponding to the values of m provided. This is expression (20) in Prass and Pumi (2019).

Author(s)

Taiane Schaedler Prass

References

Prass, T.S. and Pumi, G. (2019). On the behavior of the DFA and DCCA in trend-stationary processes <arXiv:1910.10589>.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
m = 3
K = Km(m = m, nu = 0)
G = diag(m+1)
EF2dfa(G = G, K = K)
# same as
EF2dfa(m = 3, nu = 0, G = G)

# An AR(1) example
phi = 0.4
n = 500
burn.in = 50
eps = rnorm(n + burn.in)
z.temp = numeric(n + burn.in)
z.temp[1] = eps[1]
for(i in 2:(n + burn.in)){
  z.temp[i] = phi*z.temp[i-1] + eps[i]
}
z = z.temp[(burn.in + 1):(n + burn.in)]

F2.dfa = F2dfa(z, m = 3:100, nu = 0, overlap = TRUE)
plot(3:100, F2.dfa, type="o", xlab = "m")

DCCA documentation built on Jan. 1, 2020, 5:06 p.m.

Related to EF2dfa in DCCA...