Learn R Programming

gets (version 0.1)

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':
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 (default), "mean" or "variance". Determines whether values associated with the mean or variance specification should be extracted. If NULL, then it is automatically determined whether getsm or
std
NULL (default), FALSE or TRUE. If std = FALSE, then the mean residuals are returned. If std = TRUE, then the standardised residuals are returned. If std = NULL, then it is automatically determined whether getsm
...
additional arguments

Value

  • coef:A numeric vector containing the parameter estimates
  • fitted:A zoo object
  • paths:A list with the paths searched (each number refers to the regressor ordering in the GUM)
  • print:Prints the most important parts of the search and 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 the regressor ordering in the GUM)
  • vcov:The variance-covariance matrix

See Also

getsm, getsv

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)

##undertake General-to-Specific (GETS) model selection of
##the mean:
meanmod <- getsm(mymod)

##undertake General-to-Specific (GETS) model selection of
##the log-variance:
varmod01 <- getsv(mymod)

##undertake General-to-Specific (GETS) model selection of
##the log-variance (simplified model):
varmod02 <- getsv(meanmod)

##print results:
print(meanmod)
print(varmod01)
print(varmod02)

##print the entries of object 'gets':
summary(meanmod)
summary(varmod01)
summary(varmod02)

##extract coefficients of the simplified (specific) model:
coef(meanmod) #mean spec
coef(varmod01) #log-variance spec 1
coef(varmod02) #log-variance spec 2

##extract the paths searched:
paths(meanmod) #mean
paths(varmod01) #log-variance spec 1
paths(varmod02) #log-variance spec 2

##extract the terminal models:
terminals(meanmod) #mean
terminals(varmod01) #log-variance spec 1
terminals(varmod02) #log-variance spec 2

##extract variance-covariance matrix of simplified
##(specific) model:
vcov(meanmod) #mean spec
vcov(varmod01) #log-variance spec 1
vcov(varmod02) #log-variance spec 2

##extract and plot the fitted values:
mfit <- fitted(meanmod) #mean fit
plot(mfit)
vfit01 <- fitted(varmod01) #variance fit
plot(vfit01)
vfit02 <- fitted(varmod02) #variance fit
plot(vfit02)

##extract and plot residuals:
epshat <- residuals(meanmod) #mean residuals
plot(epshat)
zhat01 <- residuals(varmod01) #standardised residuals
plot(zhat01)
zhat02 <- residuals(varmod02) #standardised residuals
plot(zhat02)

Run the code above in your browser using DataLab