Statistics Glossary → VAR (Vector Autoregression)
VAR (Vector Autoregression)analysis
A vector autoregression method that models several mutually influencing time series together, with a system of equations that explains each series by its own past and by the past of the other series.
Concept
In economics and business, variables rarely form a one-way chain of cause and effect: advertising raises sales, and higher sales in turn enlarge the next period's advertising budget. Ordinary regression, which treats one variable as 'dependent' and the others as 'independent', cannot capture this mutual feedback. A VAR model makes every series a dependent variable at the same time and models them all together.
In a VAR with p lags, each variable is linked to the values of itself and of all the variables in the system over the last p periods: y_t = c + A₁y_{t−1} + … + A_p y_{t−p} + u_t (y_t is a vector holding all the series). The number of lags is chosen with information criteria (AIC, HQ, SC, FPE). Once the model is fitted, three questions are answered: Granger causality (does one series' past improve the forecast of another?), impulse responses (how does a shock to one series affect the others over time?) and forecast error variance decomposition (how much of a series' forecast uncertainty comes from each shock?).
VAR assumes that the series are stationary and that the model is stable (all roots have modulus below 1); no autocorrelation should remain in the residuals. Granger causality is not true causation but a contribution to forecasting. Orthogonalised impulse responses depend on the ordering of the variables, which is an assumption about which variable can affect the others within the same period. The number of parameters grows quickly with the number of variables and lags, so long series are needed.
When to use it
- To model several mutually influencing stationary series together and examine their dynamic relationships and joint forecasts.
- If the series are non-stationary but share a long-run equilibrium (cointegration), use a VECM; if they are non-stationary with no cointegration, fit the VAR to the differenced series.
- If only one series is to be forecast and the other variables act on it only from outside, use ARIMAX; if the volatility (variance) of a series rather than its mean is to be modelled, use GARCH.
An everyday example
A retail chain is examining eight years of monthly advertising spend, website visits and sales together. Advertising raises visits and sales; but after a good month management also raises the advertising budget, so the effect runs both ways. A VAR model fits the three series together, and a Granger test may show that past advertising improves the sales forecast. The impulse response may reveal that a one-off rise in advertising affects sales a little in the first month, most in the second, and fades out within four or five months.
Parameters in MerQur
Series (≥ 2)
Concept: The series to be modelled together and their order. The coefficients are unaffected by the order, but the orthogonalised impulse responses and the variance decomposition are: a variable earlier in the order is assumed to affect later ones within the same period, while later ones can affect it only a period later.
Everyday example: Because the advertising budget is set at the start of the month and cannot react to that month's sales, it is listed first, followed by website visits and finally sales. Had the order been sales, visits, advertising, the impulse-response results could differ.
What it does: The series to be modelled together. The orthogonal impulse response (Cholesky) and the multivariate normality test depend on the variable order; the order is set by drag and drop in the interface.
Effect on the result: The same set of columns in a different order gives the same VAR coefficients but different orthogonal IRF and FEVD values.
On the validation data: Canada: the data order (e, prod, rw, U) and the Pfaff (2008) order (prod, e, U, rw) give the same VAR(3) coefficients and different IRF/FEVD values; IRF/FEVD depend on the variable order (Cholesky decomposition).
Date (optional)
Concept: VAR assumes the observations are arranged in time order, because a 'past value' only makes sense in the right order. The date column puts the rows in chronological order.
Everyday example: If the chain's data file runs from the newest month to the oldest and no date is selected, the model treats the future as the past and gives wrong results. Selecting the date puts the rows in the right order.
What it does: Sorts the rows by the date column; if empty, the file order is used.
Effect on the result: If the rows are in reverse order, the model is built backwards in time.
On the validation data: In a file with reversed rows, selecting the date puts the rows in chronological order and the VAR(1) values equal those of the correctly ordered file; without it the log-likelihood differs.
Lag selection (Manual (p) / AIC / HQ / SC (BIC) / FPE) and Lag p
Concept: The lag order p is how many periods back the model looks. Information criteria balance fit against the number of parameters: SC (BIC) tends to pick the most parsimonious model, AIC and FPE more lags, and HQ something in between.
Everyday example: If advertising affects sales for two months, at least 2 lags are needed. If AIC suggests 3 lags and SC 1, the analyst decides which is enough by checking whether autocorrelation remains in the residuals.
What it does: Selects p manually or by information criteria; the criteria are computed on the same sample after dropping the first lag.max observations (Lütkepohl 2005, 4.3).
Effect on the result: Model order and all results.
On the validation data: With a constant, AIC = FPE = 3, HQ = 2, SC = 1. LL for p = 1, 3, 6: -213.774, -150.609, -112.865.
Maximum lag
Concept: The largest lag the information criteria compare. So that all candidates are compared on the same sample, this many observations are dropped from the start of the series; a very large value therefore shrinks the sample needlessly in a short series.
Everyday example: With 96 months of data and a maximum lag of 12, the first 12 months are used only as past values and the comparison is made on 84 months. If no effect is expected to last more than a year, this upper limit is enough.
What it does: The largest lag tried in the criterion table and the cut-off of the common sample.
Effect on the result: Since the common sample changes, the selection may also change. If the value is reduced to min(lag_max, (T-2)/(K+1) - 1), the reason is stated in the text.
On the validation data: Canada: SC = 2 for 4, SC = 1 for 8, HQ = 1 for 12. When 24 is entered it is reduced to 15; at this limit AIC and HQ select VAR(15).
Deterministic terms (Constant / Trend / Constant + trend / No deterministic terms)
Concept: A constant, a linear trend, both or neither is added to the equations. The constant allows the series to fluctuate around a non-zero mean; the trend allows a steady rise or fall over time.
Everyday example: If the chain's sales grow steadily over the years as it opens new branches, adding a trend stops this growth from being mistaken for an advertising effect. If the series just fluctuate around a mean, a constant is enough.
What it does: A constant, a linear trend, both or neither are added to the equations.
Effect on the result: The coefficients, LL and the p selected by the criteria.
On the validation data: AIC, p = 3, LL: constant -150.609, trend -148.845, both -143.629, none -156.547.
IRF / FEVD horizon
Concept: The impulse response follows, step by step, how a one-off shock to one series affects the other series in later periods. The variance decomposition (FEVD) gives, as percentages, how much of a series' h-step forecast error variance comes from each series' shocks; the horizon is the number of periods over which this is followed.
Everyday example: With a horizon of 12, the effect of a rise in advertising on sales is followed month by month for a year. The FEVD might show, for example, that 25% of the uncertainty in sales a year ahead comes from advertising shocks and 60% from sales' own shocks.
What it does: Number of steps of the impulse response and variance decomposition.
Effect on the result: Table length; the values do not depend on the horizon.
On the validation data: FEVD, prod ← prod: 1.000 for horizon 1, 0.756 for 10, 0.684 for 20.
Forecast horizon and Confidence Level
Concept: The forecast horizon sets how many periods ahead all the series in the system are forecast together. The confidence level sets the width of both the forecast intervals and the impulse-response bands.
Everyday example: With a horizon of 6, the chain forecasts sales, visits and advertising together for the next six months. A 95% interval is wider than an 80% one; the choice depends on how much risk the budget plan accepts.
What it does: h-step forecast and its interval (mean ± z·SE(h), MSE(h) = ΣΦ_i Σ_u Φ_i'). The confidence level sets both the forecast interval and the bootstrap IRF band.
Effect on the result: Interval width.
On the validation data: Canada, prod T+1 = 417.442: %80 [416.607, 418.276], %95 [416.165, 418.718], %99 [415.763, 419.120].
IRF bootstrap replications and Random seed
Concept: The uncertainty of the impulse responses is found by generating thousands of artificial series resampled from the model's residuals and recomputing the responses for each (bootstrap). The more replications, the more stable the band; the seed lets the same band be reproduced.
Everyday example: If the band for the effect of an advertising shock on sales excludes zero in the second month, that effect is hard to put down to chance. A band from 1000 replications is more reliable than one from 100; with the same seed the report's figure can be redrawn exactly.
What it does: IRF percentile band by residual bootstrap (Runkle 1987); 0 means no band. The seed is for reproducibility.
Effect on the result: Only the IRF band.
On the validation data: e ← prod h = 1 band: B = 100 [-0.107, 0.172], 500 [-0.108, 0.172], 2000 [-0.106, 0.172]; seed 1 [-0.117, 0.161]. The same seed gives the same band.
→ Impulse response function (IRF) and Cholesky decomposition
Diagnostic lags (PT 16 · LM 5 · ARCH 5 / PT 12 · LM 4 · ARCH 4 / PT 24 · LM 8 · ARCH 8)
Concept: The model diagnostics test for structure left in the residuals: the Portmanteau and Breusch-Godfrey LM tests look for autocorrelation, and the ARCH-LM test for variance that changes over time. The lag numbers are how many periods back these tests look.
Everyday example: If autocorrelation at lag 12 remains in the sales residuals, the model has missed a yearly pattern; for the test to see this, it needs at least 12 lags. A significant ARCH-LM means that sales become noticeably less predictable in some periods.
What it does: Lags of the Portmanteau, Breusch-Godfrey LM and multivariate ARCH-LM tests.
Effect on the result: Diagnostic statistics. With (24, 8, 8) the ARCH-LM auxiliary regression has more parameters than observations, so the test is skipped and stated in the note.
On the validation data: Canada (12, 4, 4): PT 114.64, BG 70.76, ARCH 417.96; (16, 5, 5): 169.48, 85.72, 524.10; (24, 8, 8): 273.46, 148.49, ARCH skipped.
Impulse-response type: Orthogonal (Cholesky) (check box; when off, unit shock)
Concept: Orthogonalised impulse responses separate shocks that are correlated within the same period using a Cholesky decomposition and show the effect of a one-standard-deviation shock; the result depends on the ordering of the variables. With the option off, the effects are computed for a one-unit shock independent of the others.
Everyday example: If advertising and visit shocks tend to occur together within the same month, the orthogonalised option shares this joint movement out according to the order. A unit shock instead answers 'what would happen if advertising rose by one unit and no other shock occurred?'.
What it does: If ticked, a 1 SD shock orthogonalised by Cholesky (Θ_i = Φ_i P); otherwise a unit shock (Φ_i).
Effect on the result: IRF scale; FEVD is orthogonal in both cases.
On the validation data: e ← prod h = 1: orthogonal 0.0207, unit 0.1696.
→ Impulse response function (IRF) and Cholesky decomposition
Exogenous variables (VARX)
Concept: Exogenous variables affect the series in the system but are not themselves explained by it (VARX). They enter the equations as explanatory variables, but no equation of their own is fitted.
Everyday example: The number of public holidays affects sales and visits, but the chain's advertising or sales do not change the number of holidays. The holiday count is therefore added as an exogenous variable.
What it does: Exogenous variables (not explained by the model) are added to the VAR equations.
Effect on the result: The exogenous coefficients and all other coefficients.
On the validation data: Canada, first 80 observations, exogenous U, p = 2: the coefficient and SE table is given together with the exogenous U terms.
Example on real data
Data: Canada, Breitung et al. 2004, R vars
Variables: series prod (productivity), e (employment), U (unemployment), rw (real wage); JSS ordering
- Question: What dynamic structure do productivity (prod), employment (e), unemployment (U) and the real wage (rw) show together in Canada?
- Lag selection: With lag.max = 8, AIC = FPE = 3, HQ = 2, SC = 1; a VAR(3) is fitted by AIC (T = 81, log L = -150.61).
- Model: For example, in the prod equation prod.l1 = 1.148 (t = 9.61, p < .001); the R² of the equations lie between .97 and .999.
- Diagnostics: Portmanteau χ²(208) = 169.48, p = .976 (h = 16); there is no autocorrelation in the residuals. Multivariate Jarque-Bera χ²(8) = 15.24, p = .055.
- Granger causality: prod F(9, 272) = 2.91, p = .003; e F = 3.94, p < .001; U F = 2.06, p = .033; rw F = 2.15, p = .026; all four series Granger-cause the others.
- Limitation: The largest root modulus is 1.004 (greater than 1); the model is not stable, IRFs and forecasts should be interpreted with care, and a VECM should be considered.
- APA: VAR(3), T = 81; Portmanteau χ²(208) = 169.48, p = .976; prod Granger causality F(9, 272) = 2.91, p = .003.
Related concepts
Impulse response function (IRF) and Cholesky decompositionLag length selectionForecast horizon and forecast intervalExogenous variables (VARX, ARIMAX)Forecast error variance decomposition (FEVD)Ljung-Box (portmanteau) testDeterministic terms (constant, trend)Granger causality
The numbers in the examples are MerQur's output on independent, publicly available validation data; see the MerQur Technical Note for details.