data(RV5min)
result <- Longmemorytest(log(RV5min))
# Simulated example: ARFIMA(0,d,0) with d = 0.3 (true long memory)
set.seed(123)
n <- 2000
d0 <- 0.3
e <- rnorm(n)
x <- fracdiff::fracdiff.sim(n, d = d0)$series
# Apply the test (null = true long memory)
out <- Longmemorytest(x, alpha = 0.05)
out$reject_eps02 # typically FALSE
out$d_estimate
# Example: Spurious long memory due to a structural break
set.seed(123)
n <- 2000
x <- c(rnorm(n/2, 0, 1), rnorm(n/2, 2, 1)) # one-time mean shift
out <- Longmemorytest(x, alpha = 0.05)
out$reject_eps02
out$reject_eps05
Run the code above in your browser using DataLab