Order=2 particle filter fails with "measurement error on observables" even though all observables have explicit measurement errors

Dear all,

I am extending the semi-structural output gap model of Alichi et al. (2015), IMF WP/15/144. The base replication runs fine at order=1. I then added a common stochastic volatility factor — the idea is that all gap variables become jointly more volatile during turbulent periods, anyway

What I added / modified

I introduced a latent regime_factor following an AR(1) with steady state zero, which multiplicatively scales the shocks to all gap variables:

% Regime factor (common volatility, AR(1), SS=0)
regime_factor = 0.5*regime_factor(-1) + eps_regime_factor;

% Gap equations — volatility scales with exp(regime_factor)
h        = phi_h*h(-1)                     + exp(regime_factor) * eps_h;
u        = tau_1*u(-1) + tau_2*h           + exp(regime_factor) * eps_u;
lp_gap   = vartheta_1*lp_gap(-1) + vartheta_2*u  + exp(regime_factor) * eps_lp_gap;
capu_gap = kappa_1*capu_gap(-1)  + kappa_2*h     + exp(regime_factor) * eps_capu_gap;

Measurement equations (one me_xxx per observable, all in varexo and with stderr in the shocks block):

obs_dly = G + h - h(-1) + eps_Y_bar + me_dly;
obs_pi = pinf + me_pi;
obs_u = (U_bar - u) + me_u;
obs_lf = (LP_bar + lp_gap) + me_lf;
obs_cu = (CAPU_bar + capu_gap) + me_cu;
obs_pi_exp = pi_exp + me_pi_exp;

All six me_xxx also appear in estimated_params with inv_gamma_pdf priors.

estimation(
datafile = ‘data_input’,
mode_compute = 9,
mh_replic = 0,
order = 2,
smoother,
filtered_vars,
nograph,
nodiagnostic
);

The error:


options [default is 1] =  1

Estimation using a non linear filter!

ESTIMATION_CHECKS: There was an error in computing the likelihood for initial parameter values.
ESTIMATION_CHECKS: If this is not a problem with the setting of options (check the error message below),
ESTIMATION_CHECKS: you should try using the calibrated version of the model as starting values. To do
ESTIMATION_CHECKS: this, add an empty estimated_params_init-block with use_calibration option immediately b
efore the estimation
ESTIMATION_CHECKS: command (and after the estimated_params-block so that it does not get overwritten):

error: initial_estimation_checks:: particle filtering requires measurement error on the observables
error: called from
initial_estimation_checks at line 117 column 9
dynare_estimation_1 at line 164 column 5
dynare_estimation at line 105 column 5
driver at line 926 column 1
dynare at line 300 column 5

Can anyone explain what I’m doing wrong here?

Thank you in advance!

gdp_gap_garch.mod (9.1 KB)

data_input.mat (9.3 KB)

The measurement error must be specified via the shocks block (using e.g. var obs_pi;) or within the estimated_params block. It cannot be specified via regular varexo. See e.g. tests/particle/first_spec.mod · master · Dynare / dynare · GitLab

It worked, thank you! :+1: