Learn R Programming

VGAMextra (version 0.0-6)

VARff: VGLTSM family function for the Order--\(p\) Vector Auto(R)egressive Model

Description

Estimates an Order(\(p\)) 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")

Value

An object of class "vglmff"

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

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.

Author

Victor Miranda.

Details

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

VARff fits a linear model to the means of a \(K\)--variate normal distribution, where each variable, \(x_{i, t}\), \(i = 1, \ldots, K\), is a linear function of \(p\)--past lags of itself and past \(p\)--lags of the other variables. The model has the form

$$\boldsymbol{x}_t = \boldsymbol{\Phi_1} \boldsymbol{x}_{t - 1} + \cdots + \boldsymbol{\Phi_p} \boldsymbol{x}_{t - p} + \boldsymbol{\varepsilon}_t,$$ where \(\boldsymbol{\Phi_j}\) are \(K \times K\) matrices of coefficients, \(j = 1, \ldots, K\), to be estimated.

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

See Also

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

Examples

Run this code
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)

Run the code above in your browser using DataLab