Learn R Programming

gets (version 0.2)

coef.gets: Extraction functions for 'gets' objects

Description

Extraction functions for objects of class 'gets'

Usage

## S3 method for class 'gets':
coef(object, spec=NULL, ...)
## S3 method for class 'gets':
fitted(object, spec=NULL, ...)
## extraction function for class 'gets'
paths(object, ...)
## S3 method for class 'gets':
plot(x, y=NULL, col=c("red","blue"), lty=c("solid","solid"),
  lwd=c(1,1), coef.path=TRUE, ...)
## S3 method for class 'gets':
print(x, ...)
## S3 method for class 'gets':
residuals(object, std=NULL, ...)
## S3 method for class 'gets':
summary(object, ...)
## extraction function for class 'gets'
terminals(object, ...)
## S3 method for class 'gets':
vcov(object, spec=NULL, ...)

Arguments

object
an object of class 'gets'
x
an object of class 'gets'
spec
NULL, "mean", "variance" or, except vcov.gets, "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" o
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
coef.path
logical. Only applicable if there are retained indicators after the application of isat
...
additional arguments

Value

  • coef:a numeric vector containing parameter estimates
  • fitted:a zoo object with fitted values
  • paths:a list with the paths searched (each number refers to a regressor in the GUM)
  • 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 gets object
  • terminals:a list with the terminal models (each number refers to a regressor in the GUM)
  • vcov:a variance-covariance matrix

See Also

getsm, getsv, isat

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 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 the paths searched:
paths(meanmod) #mean
paths(varmod) #variance spec

##extract the terminal models:
terminals(meanmod) #mean
terminals(varmod) #variance spec

##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) #mean residuals
plot(epshat)
zhat <- residuals(varmod) #standardised residuals
plot(zhat)

##impulse indicator saturation:
set.seed(123)
y <- rnorm(30)
isatmod <- isat(y)
print(isatmod)

Run the code above in your browser using DataLab