How can I use filtered_vars options?

Dear professor,
I am trying to do one step ahead forecast, my model was calibrate, dynare report an error about ‘VAROBS statement is missing!’. I am not sure if it is because I am a calibration model, so I can’t use the estimation command?

BEST REGARDS.shuju.xlsx (12.2 KB)
mixrule_baseline.mod (20.9 KB)
parameterfile.mat (2.4 KB)

1 Like

You should run the calib_smoother on your mod-file. See the example at https://git.dynare.org/Dynare/dynare/blob/master/tests/fs2000/fs2000_calib.mod

1 Like

Thank you very much Professor jpfeifer. Your reply has helped me a lot.
I don’t quite understand the meaning of 3 and 4 in filter_step_ahead = [3:4].
I added ‘calib_smoother’ to the original code and I have this error reminder.
Error using print_info (line 42)
Blanchard Kahn conditions are not satisfied: no stable equilibrium

Error DsgeSmoother (line 108)
Print_info(info,options_.noprint, options_);

Error evaluate_smoother (line 105)
DsgeSmoother(parameters, dataset_.nobs, transpose(dataset_.data), dataset_info.missing.aindex, dataset_info.missing.state, M_, oo_, options_, bayestopt_, estim_params_);

Error mixrule_baseline (line 630)
[oo_,M_,options_,bayestopt_]=evaluate_smoother(‘calibration’,var_list_,M_,oo_,options_,bayestopt_,estim_params_);

Error dynare (line 235)
Evalin(‘base’,fname) ;
shuju.xlsx (13.3 KB)
mixrule_baseline.mod (21.1 KB)parameterfile.mat (2.4 KB)

  1. I am getting an error that the steady state cannot be computed. Is there maybe a steady state file missing.
  2. The [3:4] specifies how many steps ahead the filtered variables are computed.
  3. Regarding the Blanchard-Kahn conditions: if your model runs with simulations, check whether you have a unit root. If yes, you need to specify the diffuse_filter option.

mixrule_baseline_steadystate.m (5.0 KB)
Sorry, here is the steadystate file. If I don’t add the last one, the mod file will run successfully. So I am confused.

‘varobs R_nom m1;

calib_smoother(datafile=shuju, filtered_vars, filter_step_ahead = [3:4]) YD ND g CD ID pi;

run calibrated diffuse filter
bayestopt_=[];
calib_smoother(diffuse_filter,datafile=shuju, filtered_vars, filter_step_ahead = [3:4]) YD ND g CD ID pi;’

You never reach the line with the diffuse_filter, because the mod-file crashes in the calib_smoother-command without that option. You need to take it out.

You mean take the ‘diffuse_filter’ out in the ‘calib_smoother(diffuse_filter,datafile=shuju, filtered_vars, filter_step_ahead = [3:4]) YD ND g CD ID pi;’ centence? Or say to add % in front of this sentence ‘run calibrated diffuse filter’,There is a % in front of this sentence in the code, I accidentally deleted it when I replied.:laughing:
But I tried to remove the diffuse_filter, which means that this sentence is changed to calib_smoother(datafile=shuju, filtered_vars, filter_step_ahead = [3:4]) YD ND g CD ID pi; The program still prompts
Error using print_info (line 42)
Blanchard Kahn conditions are not satisfied: no stable equilibrium

Error DsgeSmoother (line 108)
Print_info(info,options_.noprint, options_);

Error evaluate_smoother (line 105)
DsgeSmoother(parameters, dataset_.nobs, transpose(dataset_.data), dataset_info.missing.aindex, dataset_info.missing.state, M_, oo_, options_, bayestopt_, estim_params_);

Error mixrule_baseline (line 630)
[oo_,M_,options_,bayestopt_]=evaluate_smoother(‘calibration’,var_list_,M_,oo_,options_,bayestopt_,estim_params_);

Error dynare (line 235)
Evalin(‘base’,fname) ;

Only have

calib_smoother(diffuse_filter,datafile=shuju, filtered_vars, filter_step_ahead = [3:4]) YD ND g CD ID pi;’

Thank you very much Professor jpfeifer!
Is the output in oo_.Smoother.Trend? But in this set, all endogenous variables have a value of zero. And the folder mixrule_baseline\Output is empty.

That depends on what you are looking for. Please see the manual. Filtered variables will be in oo_.FilteredVariables.

Thank you Professor Jpfeifer, you have given me a lot of help!:blush:

I am very sorry, Professor Jpfeifer, bothering you again, I hope to get the result of Figure 16 in An introduction to Graphs in Dynare, but I use the data I uploaded (the result of logarithm difference) to get a large value of the output data. (The results calculated by dynare and the data published by the state uses HP filter to take the cycle item are slightly different ).
I also Try to replace the data with only logarithmic or unprocessed data, and the results are relatively large. Do you know why?
image

It seems your observation equations are wrong. The data means and the means of the associated variables in the model differ significantly.

Thank you very much for your help Professor Jpfeifer! You have given me a lot of help!:relaxed: