coef.arx: Extraction functions for 'arx' objects

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/coef.arx.R

Description

Extraction functions for objects of class 'arx'

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  ## S3 method for class 'arx'
coef(object, spec=NULL, ...)
  ## S3 method for class 'arx'
fitted(object, spec=NULL, ...)
  ## S3 method for class 'arx'
logLik(object, ...)
  ## S3 method for class 'arx'
plot(x, spec=NULL, col=c("red","blue"),
    lty=c("solid","solid"), lwd=c(1,1), ...)
  ## S3 method for class 'arx'
predict(object, spec=NULL, n.ahead=12, newmxreg=NULL,
    newvxreg=NULL, newindex=NULL, n.sim=1000, innov=NULL, return=TRUE,
    plot=NULL, plot.options=list(), ...)
  ## S3 method for class 'arx'
print(x, signif.stars=FALSE, ...)
  ## S3 method for class 'arx'
residuals(object, std=FALSE, ...)
  ## S3 method for class 'arx'
sigma(object, ...)
  ## S3 method for class 'arx'
summary(object, ...)
  ## S3 method for class 'arx'
vcov(object, spec=NULL, ...)

Arguments

object

an object of class 'arx'

x

an object of class 'arx'

spec

NULL, "mean", "variance" or, in some instances, "both". When NULL is a valid value, then it is automatically determined whether information pertaining to the mean or variance specification should be returned

signif.stars

logical. If TRUE, then P-values are additionally encoded visually, see printCoefmat

std

logical. If FALSE (default), then the mean residuals are returned. If TRUE, then the standardised residuals are returned

n.ahead

generate forecasts up to n steps ahead (the default is 12)

newmxreg

a matrix (n.ahead rows and NCOL(mxregs) columns) with the out-of-sample values of the mxreg regressors

newvxreg

a matrix (n.ahead rows and NCOL(vxregs) columns) with the out-of-sample values of the vxreg regressors

newindex

date-index for the zoo object returned by predict.arx

n.sim

integer, the number of bootstrap replications for the generation of the variance forecasts

innov

NULL (default) or a vector of length n.ahead * n.sim containing the standardised errors (i.e. zero mean, unit variance) to bootstrap from

return

logical. If TRUE (default), then the out-of-sample forecasts are returned

plot

NULL or logical. If TRUE (default), then the out-of-sample forecasts are plotted. If NULL (default), then the value set by options determines whether a plot is produced or not.

plot.options

a list of options related to the plotting of forecasts, see 'Details'

col

colours of actual (default=blue) and fitted (default=red) lines

lty

types of actual (default=solid) and fitted (default=solid) lines

lwd

widths of actual (default=1) and fitted (default=1) lines

...

additional arguments

Details

The 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

Value

coef:

a numeric vector containing parameter estimates

fitted:

a zoo object with fitted values

logLik:

log-likelihood (normal density)

plot:

a plot of the fitted values and the residuals

predict

a vector containing the out-of-sample forecasts

print:

a print of the estimation results

residuals:

a zoo object with the residuals

sigma:

the regression standard error ('SE of regression')

summary:

a print of the items in the arx object

vcov:

variance-covariance matrix

Author(s)

Felix Pretis, http://www.felixpretis.org/
James Reade, https://sites.google.com/site/jjamesreade/
Genaro Sucarrat, http://www.sucarrat.net/

See Also

arx

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
##simulate from an AR(1):
set.seed(123)
y <- arima.sim(list(ar=0.4), 40)

##simulate four independent Gaussian regressors:
xregs <- matrix(rnorm(4*40), 40, 4)

##estimate an AR(2) with intercept and four conditioning
##regressors in the mean, and log-ARCH(3) in the variance:
mymod <- arx(y, mc=TRUE, ar=1:2, mxreg=xregs, arch=1:3)

##print results:
print(mymod)

##plot the fitted vs. actual values, and the residuals:
plot(mymod)

##generate out-of-sample forecasts of the mean:
predict(mymod, newmxreg=matrix(0,12,4))

##print the entries of object 'mymod':
summary(mymod)

##extract coefficient estimates (automatically determined):
coef(mymod)

##extract mean coefficients only:
coef(mymod, spec="mean")

##extract log-variance coefficients only:
coef(mymod, spec="variance")

##extract all coefficient estimates:
coef(mymod, spec="both")

##extract regression standard error:
sigma(mymod)

##extract log-likelihood:
logLik(mymod)

##extract variance-covariance matrix of mean equation:
vcov(mymod)

##extract variance-covariance matrix of log-variance equation:
vcov(mymod, spec="variance")

##extract and plot the fitted mean values (automatically determined):
mfit <- fitted(mymod)
plot(mfit)

##extract and plot the fitted variance values:
vfit <- fitted(mymod, spec="variance")
plot(vfit)

##extract and plot both the fitted mean and variance values:
vfit <- fitted(mymod, spec="both")
plot(vfit)

##extract and plot the fitted mean values:
vfit <- fitted(mymod, spec="mean")
plot(vfit)

##extract and plot residuals:
epshat <- residuals(mymod)
plot(epshat)

##extract and plot standardised residuals:
zhat <- residuals(mymod, std=TRUE)
plot(zhat)

gets documentation built on May 30, 2017, 4:09 a.m.

Search within the gets package
Search all R packages, documentation and source code