View source: R/gets-base-source.R
coef.arx | R Documentation |
Extraction functions for objects of class 'arx'
## S3 method for class 'arx'
coef(object, spec=NULL, ...)
## S3 method for class 'arx'
fitted(object, spec=NULL, ...)
## S3 method for class 'arx'
logLik(object, ...)
## S3 method for class 'arx'
model.matrix(object, spec=c("mean","variance"), response=FALSE, as.zoo=TRUE, ...)
## S3 method for class 'arx'
nobs(object, spec=NULL, ...)
## S3 method for class 'arx'
plot(x, spec=NULL, col=c("red","blue"),
lty=c("solid","solid"), lwd=c(1,1), ...)
## S3 method for class 'arx'
print(x, signif.stars=TRUE, ...)
## S3 method for class 'arx'
residuals(object, std=FALSE, ...)
## S3 method for class 'arx'
sigma(object, ...)
## S3 method for class 'arx'
summary(object, ...)
## S3 method for class 'arx'
vcov(object, spec=NULL, ...)
object |
an object of class 'arx' |
x |
an object of class 'arx' |
spec |
|
response |
|
as.zoo |
|
signif.stars |
|
std |
|
col |
colours of actual (default=blue) and fitted (default=red) lines |
lty |
types of actual (default=solid) and fitted (default=solid) lines |
lwd |
widths of actual (default=1) and fitted (default=1) lines |
... |
additional arguments |
coef: |
a numeric vector containing parameter estimates |
fitted: |
a |
logLik: |
log-likelihood (normal density) |
model.matrix: |
a matrix with the regressors and, optionally, the response |
nobs: |
the number of observations |
plot: |
a plot of the fitted values and the residuals |
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: |
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, http://www.sucarrat.net/
arx
##simulate from an AR(1):
set.seed(123)
y <- arima.sim(list(ar=0.4), 40)
##simulate four independent Gaussian regressors:
xregs <- matrix(rnorm(4*40), 40, 4)
##estimate an 'arx' model: 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 regression standard error:
sigma(mymod)
##extract log-likelihood:
logLik(mymod)
##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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.