Bayesian estimation about variable measurement error

Dear professor,
I got a questions on Bayesian esimation.When I run my code,the dynare show a mistake:The variable R has to be declared as observable since you assume a measurement error on it. Howver,the residuals of the static equations,steady-state results and eigenvalues are no problem.The model_diagnostics show that no obvious problems with this mod-file were detected.I spent a week and still can’t solve this problem.
The variable of my code is written in level, the observation is:
where y_obs,c_obs,i_obs is oberved variable (the data after first seasonally adjust, take log, and HP-filter),and pi_obs,r_obs(the data after first seasonally adjust, and HP-filter).
Really hope for your reply which always help me a lot, thank you, professor.

Please provide the mod-file.

Thanks for your attention.

The line

defines measurement error on the endogenous variable R, but R is not an observable.

fiscal3.mod (6.3 KB)

Professor,I changed "stderr R,inv_gamma_pdf,0.01,inf ",or add
a measurement error on the r_obs equation:r_obs=log(R)-log(Rbar)+e_r_obs,but the dynare show that the variable R has to be declared as observable since you assume a measurement error on it.

I cancel the r_obs,dynare also show the same mistake.I don’t know what’s the reason for this problem.Please help.Thank you.

Again, you cannot assume measurement error on something not defined as an varobs.

I get it.But I define the e_r_obs at the end of varexo

I found that there is no same problem on the Dynare Forum.Can you give me some suggestion to deal with the problem?

You are confusing variable types here.

stderr R,inv_gamma_pdf,0.01,2;

is the syntax for measurement error on endogenous variables without defining varexo.
If you want to set e_r_obs, it should be

stderr e_r_obs,inv_gamma_pdf,0.01,2;

Thank you.I get it.