RainbowStats™ · Time-series commands

VAR_MODEL

Estimate a reduced-form vector autoregression with a chosen lag order.

Syntax

V=VAR_MODEL(alignedList,lags)

Runnable example

Growth=SERIES_BETWEEN(SAME_DATE_RANGE(LOGDIFF(INDPRO),LOGDIFF(PAYEMS)),19750101,20191231)
V=VAR_MODEL(Growth,12)
EXTRACT(V,"chart:0")

Inputs and preparation

Supply a DataList and a positive integer lag order accepted by the model. Each equation uses the chosen number of lags of all input variables. Lags count observations, not calendar months: verify regular spacing and common frequency.

The command passes the list to the VAR model without independently aligning it. Align and inspect inputs first. SAME_DATE_RANGE can change frequency and date labels; do not assume it only trims endpoints.

The supplied series are modeled as supplied. There is no automatic differencing, lag-order selection or stationarity test. Use suitably stationary inputs for conventional stable-VAR analysis. Levels VARs require separate econometric justification. LOGDIFF requires positive levels and returns fractional log changes; it does not multiply by 100.

In the example, earlier history is transformed before clipping to January 1975 through December 2019, retaining the preceding observation needed to compute January growth. The example demonstrates syntax; it does not establish stationarity, optimal lag order or causal identification.

Extracts

KeyMeaning
modelCoefficient table, including equation targets, lags and coefficient statistics.
chart:0Actual versus fitted chart for the first input variable. Replace 0 with a valid zero-based equation index.
shockdiff:target:shockSeries:shockSizeConditional shock-path minus baseline for the selected target; the installed extract uses 24 steps.
dsgeThe installed VAR(1) conversion. Do not assume arbitrary higher-order VAR conversion or structural economic identification.

Unknown keys fall back to the model table. A returned table is not evidence that a requested diagnostic or extract exists.

Shock interpretation

EXTRACT(V,"shockdiff:0:1:0.01")

This requests target index 0 after a perturbation to input index 1, using the original list order. It does not select variables by economic name. Shock size is in the supplied variable units: 0.01 in raw log growth is approximately one percent, whereas 1 in growth already multiplied by 100 is approximately one percentage point of that growth measure.

The response retains the target's units. For a growth VAR it is a difference in growth paths, not a cumulative change in the level. Do not label it a supply shock, demand shock, structural elasticity or identified causal impulse response without additional identification.

The extract exposes no start-date, shock-timing, initialization, confidence-band or covariance-identification argument. Those conventions belong to the underlying scenario engine. Do not invent them or attach the perturbation to a particular historical event.

Comparing with VECM

VAR_MODEL(LOGDIFF(Levels),12) uses 12 lagged changes. VECM_MODEL(Levels,13,rank) also uses 12 lagged changes, because the VECM argument is the equivalent levels-VAR order. Check effective samples separately before comparing fit; matching lag counts alone does not establish comparable estimation windows.

Available extracts

Save the command result in a variable, then use EXTRACT(result, "key"). Availability can depend on the input form and fitted model.

In indexed patterns such as beta:n, replace n with the required index.

Learn more

Detailed guide and examples