Learn R Programming

gets (version 0.1)

coef.arx: Extraction functions for 'arx' objects

Description

Extraction functions for objects of class 'arx'

Usage

## S3 method for class 'arx':
coef(object, spec = c("mean", "variance", "both"), ...)
## S3 method for class 'arx':
fitted(object, spec = c("mean", "variance"), ...)
## 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 = c("mean", "variance"), ...)

Arguments

object
an object of class 'arx'
x
an object of class 'arx'
spec
extract values for the 'mean' or 'variance' specification, or 'bothl' (where applicable)
std
logical. If FALSE (default), then the mean residuals are returned. If TRUE, then the standardised residuals are returned
...
additional arguments

Value

  • coef:A numeric vector containing the parameter estimates
  • fitted:A zoo object
  • print:Prints the most important parts of the estimation results
  • residuals:A zoo object with the residuals
  • summary:A print of the items in the arx object
  • vcov:The 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)

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

##extract mean coefficients:
coef(mymod)

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

##extract all coefficients:
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:
mfit <- fitted(mymod)
plot(mfit)

##extract and plot the fitted variance:
vfit <- fitted(mymod, spec="variance")
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