View source: R/gets-base-source.R
coef.gets | R Documentation |
Extraction functions for objects of class 'gets'
## S3 method for class 'gets'
coef(object, spec=NULL, ...)
## S3 method for class 'gets'
fitted(object, spec=NULL, ...)
## S3 method for class 'gets'
logLik(object, ...)
## S3 method for class 'gets'
plot(x, spec=NULL, col=c("red","blue"),
lty=c("solid","solid"), lwd=c(1,1), ...)
## S3 method for class 'gets'
predict(object, spec=NULL, n.ahead=12, newmxreg=NULL,
newvxreg=NULL, newindex=NULL, n.sim=5000, innov=NULL, probs=NULL,
ci.levels=NULL, quantile.type=7, return=TRUE, verbose=FALSE, plot=NULL,
plot.options=list(), ...)
## S3 method for class 'gets'
print(x, signif.stars=TRUE, ...)
## S3 method for class 'gets'
residuals(object, std=NULL, ...)
## S3 method for class 'gets'
sigma(object, ...)
## S3 method for class 'gets'
summary(object, ...)
## S3 method for class 'gets'
vcov(object, spec=NULL, ...)
object |
an object of class 'gets' |
x |
an object of class 'gets' |
spec |
NULL, "mean", "variance" or, in some instances, "both". When |
signif.stars |
|
std |
|
n.ahead |
|
newmxreg |
a |
newvxreg |
a |
newindex |
|
n.sim |
|
innov |
|
probs |
|
ci.levels |
|
quantile.type |
an integer between 1 and 9 that selects which algorithm to be used in computing the quantiles, see the argument |
return |
|
verbose |
|
plot |
|
plot.options |
a |
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 |
The plot.options
argument is a list
that controls the prediction plot, see 'Details' in predict.arx
coef: |
a numeric vector containing parameter estimates |
fitted: |
a |
logLik: |
a numeric, the log-likelihood (normal density) |
plot: |
a plot of the fitted values and the residuals |
predict: |
a |
print: |
a print of the estimation results |
residuals: |
a |
sigma: |
the regression standard error ('SE of regression') |
summary: |
a print of the items in the |
vcov: |
a variance-covariance matrix |
Felix Pretis, https://felixpretis.climateeconometrics.org/
James Reade, https://sites.google.com/site/jjamesreade/
Moritz Schwarz, https://www.inet.ox.ac.uk/people/moritz-schwarz
Genaro Sucarrat, https://www.sucarrat.net/
getsm
, getsv
, isat
##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)
##generate and plot predictions of the mean:
predict(meanmod, plot=TRUE)
##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 log-likelihood:
logLik(mymod)
##extract coefficient-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)
plot(epshat)
##extract and plot standardised residuals:
zhat <- residuals(varmod)
plot(zhat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.