VAR forecast
Posted: Sun Jun 15, 2025 5:29 am
Hi,
when running the code below, i get the error message:
but, there is no scenario-option in a VAR object? Is this a bug?
Thomas
when running the code below, i get the error message:
No scenario specified in "VAR1.FORECAST _FC" on line 20.
but, there is no scenario-option in a VAR object? Is this a bug?
Thomas
Code: Select all
%var_name = "var1" ' Name of the VAR object
%est_sample = "1990Q1 2024Q4" ' Estimation sample
' --- STEP 2: CREATE WORKFILE AND SYNTHETIC DATA ---
wfcreate q 1960Q1 2100
' Generate synthetic data for variables
series y = 100 + 0.5*@trend + 10*@nrnd ' Dependent variable
series y_star = 100 + 0.6*@trend + 8*@nrnd ' Target variable
series output_gap = 2*@nrnd ' Output gap
series inflation_rate = 1 + 0.5*@nrnd ' Inflation rate
' --- STEP 3: GROUP VARIABLES AND SET ESTIMATION SAMPLE ---
group var_vars y_star output_gap inflation_rate
smpl {%est_sample}
' --- STEP 4: ESTIMATE MULTI-VARIABLE VAR ---
var {%var_name}.ls 1 2 var_vars ' VAR(2) with 3 variables
smpl 2020 @last
{%var_name}.forecast _fc ' Generate forecasts with suffix "_fc"