VARff {VGAMextra} | R Documentation |
Estimates an Order(p) Vector Autoregressive Models (VAR(p)) with white noise random errors by maximum likelihood estimation using Fisher scoring.
VARff(VAR.order = 1, zero = c("var", "cov"), lmean = "identitylink", lvar = "loge", lcov = "identitylink")
VAR.order |
Length–1 (positive) integer vector. The order of the VAR to be fitted. |
zero |
Integer or character - string vector.
Same as |
lmean, lvar, lcov |
Same as |
Let x[t] = (x[1, t], …, x[K, t])^T be a time dependent vector of responses, with index t = 1, …, T, and e[t] = (e[1, t], …, e[K, t])^T white noise with covariance matrix V.
VARff
fits a linear model to the means of a
K–variate normal distribution, where
each variable, x[i, t], i = 1, …, K,
is a linear function of p–past
lags of itself and past p–lags of the other variables.
The model has the form
x[t] = Φ[1] * x[t - 1] + … + Φ[p] * x[t - p] + e[t]
where Φ[j] are K x K matrices of coefficients, j = 1, …, K, to be estimated.
The elements of the covariance matrix are intercept–only by default.
An object of class "vglmff"
(see vglmff-class
) to be
used by VGLM/VGAM modelling functions, e.g.,
vglm
or vgam
.
Victor Miranda.
MVNcov
,
zero
,
Links
,
ECM.EngleGran
,
vglm
.
set.seed(20170227) nn <- 60 var.data <- data.frame(x2 = runif(nn, -2.5, 2.5)) var.data <- transform(var.data, y1 = rnorm(nn, 1.5 - 2 * x2, sqrt(exp(1.5))), y2 = rnorm(nn, 1.0 - 1 * x2, sqrt(exp(0.75))), y3 = rnorm(nn, 0.5 + 1 * x2, sqrt(exp(1.0)))) fit.var <- vglm(cbind(y1, y2, y3) ~ x2, VARff(VAR.order = 2), trace = TRUE, data = var.data) coef(fit.var, matrix = TRUE) summary(fit.var) vcov(fit.var)