# NOT RUN {
ms = seq(3,100,1)
hs = seq(0,50,1)
overlap = TRUE
nu = 0
m_max = (max(ms)+1)*(max(hs)+1) - max(ms)*max(hs)*as.integer(overlap)
theta = c(c(1,(20:1)/10), rep(0, m_max - 20))
Gamma1 = diag(m_max+1)
Gamma2 = matrix(0, ncol = m_max+1, nrow = m_max+1)
Gamma12 = matrix(0, ncol = m_max+1, nrow = m_max+1)
for(t in 1:(m_max+1)){
for(h in 0:(m_max+1-t)){
Gamma2[t,t+h] = sum(theta[1:(length(theta)-h)]*theta[(1+h):length(theta)])
Gamma2[t+h,t] = Gamma2[t,t+h]
Gamma12[t,t+h] = theta[h+1]
}
}
covdfa1 = covF2dfa(m = ms, nu = 0, h = hs,
overlap = TRUE, G = Gamma1, Cumulants = NULL)
covdfa2 = covF2dfa(m = ms, nu = 0, h = hs,
overlap = TRUE, G = Gamma2, Cumulants = NULL)
cr = rainbow(100)
plot(ms, covdfa1[,1], type = "l", ylim = c(0,20),
xlab = "m", ylab = expression(gamma[DFA](h)), col = cr[1])
for(i in 2:ncol(covdfa1)){
points(ms, covdfa1[,i], type = "l", col = cr[i])
}
lattice::wireframe(covdfa1, drape = TRUE,
col.regions = rev(rainbow(150))[50:150],
zlab = expression(gamma[DFA]), xlab = "m", ylab = "h")
# }
Run the code above in your browser using DataLab