
Last chance! 50% off unlimited learning
Sale ends in
"coef"(object, spec=NULL, ...) "fitted"(object, spec=NULL, ...) "logLik"(object, ...) "plot"(x, spec=NULL, col=c("red","blue"), lty=c("solid","solid"), lwd=c(1,1), ...) "predict"(object, spec=NULL, n.ahead=12, newmxreg=NULL, newvxreg=NULL, newindex=NULL, n.sim=1000, innov=NULL, return=TRUE, plot=TRUE, plot.options=list(), ...) "print"(x, ...) "residuals"(object, std=NULL, ...) "summary"(object, ...) "vcov"(object, spec=NULL, ...)
NULL
is a valid value, then it is automatically determined whether information pertaining to the mean or variance specification should be returnedn.ahead
rows and NCOL(mxregs) columns) with the out-of-sample values of the mxreg
regressorsn.ahead
rows and NCOL(vxregs) columns) with the out-of-sample values of the vxreg
regressorszoo
object returned by predict.arx
NULL
(default) or a vector of length n.ahead * n.sim
containing the standardised errors (i.e. zero mean, unit variance) to bootstrap fromTRUE
(default), then the out-of-sample forecasts are returnedTRUE
(default), then the out-of-sample forecasts are plottedlist
of options related to the plotting of forecasts, see 'Details'plot.options
argument is a list that can contain any of the following arguments:keep
: integer greater than zero (default is 10) that controls the number of in-sample actual values to plot
fitted
: If TRUE
, then the fitted values as well as actual values are plotted in-sample. The default is FALSE
errors.only
: logical or NULL
(the default). If TRUE
, then only mean forecasts are plotted when spec
is set to "both"
legend.loc
: character string (the default is "topleft"). Allows the location of the plot legend to be altered
newmactual
: numeric vector or NULL
(default). Enables the plotting of actual values out-of-sample in addition to the forecasts
getsm
, getsv
, isat
##Simulate from an AR(1):
set.seed(123)
y <- arima.sim(list(ar=0.4), 100)
##Simulate four independent Gaussian regressors:
xregs <- matrix(rnorm(4*100), 100, 4)
##estimate an AR(2) with intercept and four conditioning
##regressors in the mean, and a log-ARCH(3) in the variance:
mymod <- arx(y, mc=TRUE, ar=1:2, mxreg=xregs, arch=1:3)
##General-to-Specific (GETS) model selection of the mean:
meanmod <- getsm(mymod)
##General-to-Specific (GETS) model selection of the variance:
varmod <- getsv(mymod)
##print results:
print(meanmod)
print(varmod)
##plot the fitted vs. actual values, and the residuals:
plot(meanmod)
plot(varmod)
##print the entries of object 'gets':
summary(meanmod)
summary(varmod)
##extract coefficients of the simplified (specific) model:
coef(meanmod) #mean spec
coef(varmod) #variance spec
##extract log-likelihood:
logLik(mymod)
##extract variance-covariance matrix of simplified
##(specific) model:
vcov(meanmod) #mean spec
vcov(varmod) #variance spec
##extract and plot the fitted values:
mfit <- fitted(meanmod) #mean fit
plot(mfit)
vfit <- fitted(varmod) #variance fit
plot(vfit)
##extract and plot residuals:
epshat <- residuals(meanmod)
plot(epshat)
##extract and plot standardised residuals:
zhat <- residuals(varmod)
plot(zhat)
Run the code above in your browser using DataLab