# NOT RUN {
##Simulate from an AR(1):
set.seed(123)
y <- arima.sim(list(ar=0.4), 80)
##Simulate four independent Gaussian regressors:
xregs <- matrix(rnorm(2*80), 80, 2)
##estimate an AR(2) with intercept and four conditioning
##regressors in the mean, and a log-ARCH(3) with log(xregs^2) as
##regressors in the log-variance:
gum01 <- arx(y, mc=TRUE, ar=1:2, mxreg=xregs, arch=1:3,
vxreg=log(xregs^2))
##GETS model selection of the mean:
meanmod01 <- getsm(gum01)
##GETS model selection of the log-variance:
varmod01 <- getsv(gum01)
##GETS model selection of the mean with the mean intercept
##excluded from removal:
meanmod02 <- getsm(gum01, keep=1)
##GETS model selection of the mean with non-default
#serial-correlation diagnostics settings:
meanmod03 <- getsm(gum01, ar.LjungB=list(pval=0.05))
##GETS model selection of the mean with very liberal
##(20 percent) significance levels:
meanmod04 <- getsm(gum01, t.pval=0.2)
##GETS model selection of log-variance with all the
##log-ARCH terms excluded from removal:
varmod03 <- getsv(gum01, keep=2:4)
# }
Run the code above in your browser using DataLab