VARff {VGAMextra}R Documentation

VGLTSM family function for the Order–pp Vector Auto(R)egressive Model

Description

Estimates an Order(pp) Vector Autoregressive Models (VAR(p)) with white noise random errors by maximum likelihood estimation using Fisher scoring.

Usage

            VARff(VAR.order = 1,
                  zero = c("var", "cov"),
                  lmean = "identitylink",
                  lvar  = "loglink",
                  lcov  = "identitylink")
                    

Arguments

VAR.order

Length–1 (positive) integer vector. The order of the VAR to be fitted.

zero

Integer or character - string vector. Same as MVNcov. Details at zero.

lmean, lvar, lcov

Same as MVNcov.

Details

Let xt=(x1,t,,xK,t)T\boldsymbol{x}_t = (x_{1, t}, \ldots, x_{K, t})^T be a time dependent vector of responses, with index t=1,,Tt = 1, \ldots, T, and εt=(ε1,t,,εK,t)\boldsymbol{\varepsilon}_t = (\varepsilon_{1, t}, \ldots, \varepsilon_{K, t}) white noise with covariance matrix V\boldsymbol{\textrm{V}}.

VARff fits a linear model to the means of a KK–variate normal distribution, where each variable, xi,tx_{i, t}, i=1,,Ki = 1, \ldots, K, is a linear function of pp–past lags of itself and past pp–lags of the other variables. The model has the form

xt=Φ1xt1++Φpxtp+εt,\boldsymbol{x}_t = \boldsymbol{\Phi_1} \boldsymbol{x}_{t - 1} + \cdots + \boldsymbol{\Phi_p} \boldsymbol{x}_{t - p} + \boldsymbol{\varepsilon}_t,

where Φj\boldsymbol{\Phi_j} are K×KK \times K matrices of coefficients, j=1,,Kj = 1, \ldots, K, to be estimated.

The elements of the covariance matrix are intercept–only by default.

Value

An object of class "vglmff" (see vglmff-class) to be used by VGLM/VGAM modelling functions, e.g., vglm or vgam.

Author(s)

Victor Miranda.

See Also

MVNcov, zero, Links, ECM.EngleGran, vglm.

Examples

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)

[Package VGAMextra version 0.0-6 Index]