# NOT RUN {
# GMAR model
params13 <- c(1.4, 0.88, 0.26, 2.46, 0.82, 0.74, 5.0, 0.68, 5.2, 0.72, 0.2)
tests13 <- quantileResidualTests(VIX, 1, 3, params13)
# Restricted GMAR model, using the given data instead of simulated data
params12r <- c(1.4, 1.8, 0.88, 0.29, 3.18, 0.84)
tests12r <- quantileResidualTests(VIX, 1, 2, params12r, restricted=TRUE, nsimu=1)
# StMAR model
params12t <- c(1.38, 0.88, 0.27, 3.8, 0.74, 3.15, 0.8, 120, 3.6)
tests12t <- quantileResidualTests(VIX, 1, 2, params12t, StMAR=TRUE,
lagsAC=c(1, 5, 10), lagsCH=c(1, 5, 10))
# GMAR model as a mixture of AR(2) and AR(1) models
R <- list(diag(1, ncol=2, nrow=2), as.matrix(c(1, 0)))
params22c <- c(1.2, 0.85, 0.04, 0.3, 3.3, 0.77, 2.8, 0.77)
tests22c <- quantileResidualTests(VIX, 2, 2, params22c, constraints=TRUE, R=R)
# Such StMAR(3,2) that the AR coefficients are restricted to be
# the same for both regimes and that the second AR coefficients are
# constrained to zero.
params32trc <- c(2.2, 1.8, 0.88, -0.03, 2.4, 0.27, 0.40, 3.9, 1000)
qr32trc <- quantileResidualTests(VIX, 3, 2, params32trc, StMAR=TRUE,
restricted=TRUE, constraints=TRUE,
R=matrix(c(1, 0, 0, 0, 0, 1), ncol=2),
lagsAC=c(1, 5, 10), lagsCH=c(1, 5, 10))
# }
Run the code above in your browser using DataLab