View source: R/ARIMAX.errors.ff.R
ARIMAX.errors.ff | R Documentation |
(p, q)
ARMA errorsA VLTSMff for dynamic regression.
Estimates regression models with order–(p, d, q)
ARIMA
errors by maximum likelihood.
ARIMAX.errors.ff(order = c(1, 1, 1),
zero = "var", # optionally, "mean".
order.trend = 0,
include.int = TRUE,
diffCovs = TRUE,
xLag = 0,
include.currentX = TRUE,
lvar = "loglink",
lmean = "identitylink")
order |
The usual |
zero |
What linear predictor is modelled as intercept–only?
See |
order.trend |
Non–negative integer. Allows to incorporate a polynomial
trend of order |
include.int |
Logical. Should an intercept (int) be included in
the model for |
diffCovs |
Logical. If |
xLag |
Integer. If entered, the covariates, say
|
include.currentX |
Logical. If |
lvar, lmean |
Link functions applied to conditional mean and the variance.
Same as |
The generalized linear regression model with ARIMA errors is another subclass of VGLTSMs (Miranda and Yee, 2018).
For a univariate time series, say y_t
,
and a p
–dimensional vector of covariates
\boldsymbol{x}_t
covariates,
the model described by this VGLTSM family function is
y_t = \boldsymbol{\beta}^T \boldsymbol{x}_t + u_t,
u_t = \theta_1 u_{t - 1} + \cdots + \theta_p u_{t - p} + z_t +
\phi_1 z_{t - 1} + \cdots + \phi_1 z_{t - q}.
The first entry in x_t
equals 1, allowing
an intercept, for every $t$. Set
include.int = FALSE
to set this to zero,
dimissing the intercept.
Also, if diffCovs = TRUE
, then the differences up to order
d
of the set
\boldsymbol{x}_t
are embedded in the model
for y_t
.
If xLag
> 0
, the lagged values up to order
xLag
of the covariates are also included.
The random disturbances z_t
are by default
handled as N(0, \sigma^2_z)
. Then,
denoting \Phi_{t}
as the history of the
process (x_{t + 1}, u_t)
up to time t
, yields
E(y_t | \Phi_{t - 1}) = \boldsymbol{\beta}^T \boldsymbol{x}_t +
\theta_1 u_{t - 1} + \cdots + \theta_p u_{t - p} +
\phi_1 z_{t - 1} + \cdots + \phi_1 z_{t - q}.
Denoting \mu_t = E(y_t | \Phi_{t - 1}),
the default linear predictor for this VGLTSM family function is
\boldsymbol{\eta} = ( \mu_t, \log \sigma^2_{z})^T.
An object of class "vglmff"
(see vglmff-class
)
to be used by VGLM/VGAM modelling functions, e.g.,
vglm
or vgam
.
If d = 0
in order
, then ARIMAX.errors.ff
will perform as ARIMAXff
.
Victor Miranda
ARIMAXff
,
CommonVGAMffArguments
,
uninormal
,
vglm
.
### Estimate a regression model with ARMA(1, 1) errors.
## Covariates are included up to lag 1.
set.seed(20171123)
nn <- 250
x2 <- rnorm(nn) # One covariate
sigma2 <- exp(1.15); theta1 <- 0.5; phi1 <- 0.27 # True coefficients
beta0 <- 1.25; beta1 <- 0.25; beta2 <- 0.5
y <- numeric(nn)
u <- numeric(nn)
z <- numeric(nn)
u[1] <- rnorm(1)
z[1] <- rnorm(1, 0, sqrt(sigma2))
for(ii in 2:nn) {
z[ii] <- rnorm(1, 0, sqrt(sigma2))
u[ii] <- theta1 * u[ii - 1] + phi1 * z[ii - 1] + z[ii]
y[ii] <- beta0 + beta1 * x2[ii] + beta2 * x2[ii - 1] + u[ii]
}
# Remove warm-up values.
x2 <- x2[-c(1:100)]
y <- y[-c(1:100)]
plot(ts(y), lty = 2, col = "blue", type = "b")
abline(h = 0, lty = 2)
## Fit the model.
ARIMAX.reg.fit <- vglm(y ~ x2, ARIMAX.errors.ff(order = c(1, 0, 1), xLag = 1),
data = data.frame(y = y, x2 = x2), trace = TRUE)
coef(ARIMAX.reg.fit, matrix = TRUE)
summary(ARIMAX.reg.fit, HD = FALSE)
# Compare to arima()
# arima() can't handle lagged values of 'x2' by default, but these
# may entered at argument 'xreg'.
arima(y, order = c(1, 0, 1), xreg = cbind(x2, c(0, x2[-150])))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.