Learn R Programming

gets (version 0.2)

coef.arx: Extraction functions for 'arx' objects

Description

Extraction functions for objects of class 'arx'

Usage

## S3 method for class 'arx':
coef(object, spec=NULL, ...)
## S3 method for class 'arx':
fitted(object, spec=NULL, ...)
## S3 method for class 'arx':
plot(x, y=NULL, col=c("red","blue"), lty=c("solid","solid"),
  lwd=c(1,1), spec=NULL, ...)
## S3 method for class 'arx':
print(x, ...)
## S3 method for class 'arx':
residuals(object, std=FALSE, ...)
## 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, except vcov.arx, "both". If NULL, then it is automatically determined whether information pertaining to the mean or variance specification should be returned. This can be overridden by either "mean", "variance" or
std
logical. If FALSE (default), then the mean residuals are returned. If TRUE, then the standardised residuals are returned
y
unused
col
colours of fitted (default=red) and actual (default=blue) lines
lty
types of fitted (default=solid) and actual (default=solid) lines
lwd
widths of fitted (default=1) and actual (default=1) lines
...
additional arguments

Value

  • coef:a numeric vector containing parameter estimates
  • fitted:a zoo object with fitted values
  • plot:a plot of the fitted values and the residuals
  • print:a print of the estimation results
  • residuals:a zoo object with the residuals
  • summary:a print of the items in the arx object
  • vcov:variance-covariance matrix

See Also

arx

Examples

Run this code
##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 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)

##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 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)

Run the code above in your browser using DataLab