# NOT RUN {
require(xts)
require(parallel)
data(sp500ret)
spx = as.xts(sp500ret)
nn = nrow(spx)
nx = nn-round(0.9*nn,0)
if(nx<!-- %%50!=0) nx = nx+(50-nx%%50) -->
h = (nx/50)-1
indexin = lapply(1:h, function(j){ tail(seq(1,(nn-nx)+j*50, by=1),250) })
indexout = lapply(indexin, function(x){ (tail(x,1)+1):(tail(x,1)+50) })
cl = makePSOCKcluster(5)
mod = arfimacv(spx, indexin, indexout, ar.max = 2, ma.max = 2,
criterion = c("rmse","mae","berkowitzp")[1],
berkowitz.significance = 0.05, arfima = FALSE, include.mean = NULL,
distribution.model = "norm", cluster = cl, external.regressors = NULL,
solver = "solnp")
stopCluster(cl)
# }
Run the code above in your browser using DataLab