Log linear measurement equations in non-linear model


I have a question on measurement equations. I consider non-linear model but I use log linear transformation for the data (some of ts) and hence I write:

// Measurement equations

yobs = 100*( log(y / y(-1)) + log(gammaz) - log(gammazss)) ;
cobs = 100*(log(c / c(-1)) + log(gammaz) - log(gammazss)) ;
invobs = 100*(log(inv / inv(-1)) + log(gammaz) - log(gammazss));
wobs = 100*(log(w / w(-1)) + log(gammaz) - log(gammazss) + wobs_er);
piobs = 100*(log(pi) - log(piss));
Robs = r4;
vobs = log(teta
(l-(1-rho)n(-1))) - log(vss);
uobs = 100
((l-n)/l - uss);

I got quite standard results for my estimation. But I couldn’t match my smoothed variables back to the data. I tried the transformation : y_model = exp( y_smoothedvariable + log( y_model)) and it worked only for prices… Even though it is weird since dynare does linearization and not log-linearization by default.

Do you know what is the matter, or I just shall use non-linear measurement equations?
Thanks a lot!

Could you please provide step by step information on what you are doing. By construction the smoothed variables will coincide with the data you provide during estimation - unless there is measurement error or stochastic singularity.

Thank you so much for your quick answer.

For example inflation: if I take oo_.SmoothedVariables.pi then I fit the data that corresponds to oo_.SmoothedVariables.piobs. No problem here. So the smoothed variables are already presented in log deviations.

But I cant fit the data on gdp. I do :

yobs(ii,:slight_smile: = oo_.SmoothedVariables.y(ii,:slight_smile: - oo_.SmoothedVariables.y (ii-1,:slight_smile: + oo_.SmoothedVariables.gammaz (ii,:slight_smile:

And the series are very close but no the same (see attached picture) meaning that this is a little missmatch between oo_.SmoothedVariables.yobs(ii,:slight_smile: and yobs (ii,:). for all ii of the sample.

Do you have an idea what’s happening?

I don’t consider gammazss since oo_.SmoothedVariables.gammaz = log(gammaz) + log (gammazss).

Sorry, but the attachement is missing. Please clarify what the observation equation is and which smoothed object(s) you use to construct a series corresponding to the data.

I tried to attach the figure, but it didnt work, sorry.

So for GDP. Data is constructed as follow:

(Ln(y_t/y_{t-1}) - mean Ln(y_t/y_{t-1}) ] )*100 and that is my yobs

Observation equation in dynare:

100*( log(y / y(-1)) + log(gammaz) - log(gammazss))
where gamma - technological shock, gammazss - trend.

The model is nonlinear. I estimate and I have smoothed variables as an outcome.

After estimation I construct
yobs_new(ii,:slight_smile: = oo_.SmoothedVariables.y(ii,:slight_smile: - oo_.SmoothedVariables.y (ii-1,:slight_smile: + oo_.SmoothedVariables.gammaz (ii,:slight_smile:

The problem is that yobs_new does not match yobs. The difference between them is super small but it is there.

You should have a

somewhere. In your reconstruction, you are using the level of y. But in

you have the logarithm of y.