log linear measurement equations in non-linear model

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

log linear measurement equations in non-linear model

Postby Azh » Fri Mar 04, 2016 8:23 pm

Hi,

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 = r*4;
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!
Azh
 
Posts: 7
Joined: Mon Dec 08, 2014 6:39 pm

Re: log linear measurement equations in non-linear model

Postby jpfeifer » Sat Mar 05, 2016 7:06 am

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: log linear measurement equations in non-linear model

Postby Azh » Sat Mar 05, 2016 11:37 am

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,:) = oo_.SmoothedVariables.y(ii,:) - oo_.SmoothedVariables.y (ii-1,:) + oo_.SmoothedVariables.gammaz (ii,:)

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,:) 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).
Last edited by Azh on Sat Mar 05, 2016 1:38 pm, edited 2 times in total.
Azh
 
Posts: 7
Joined: Mon Dec 08, 2014 6:39 pm

Re: log linear measurement equations in non-linear model

Postby jpfeifer » Sun Mar 06, 2016 7:17 pm

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: log linear measurement equations in non-linear model

Postby Azh » Mon Mar 07, 2016 10:57 am

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,:) = oo_.SmoothedVariables.y(ii,:) - oo_.SmoothedVariables.y (ii-1,:) + oo_.SmoothedVariables.gammaz (ii,:)

The problem is that yobs_new does not match yobs. The difference between them is super small but it is there.
Azh
 
Posts: 7
Joined: Mon Dec 08, 2014 6:39 pm

Re: log linear measurement equations in non-linear model

Postby jpfeifer » Mon Mar 07, 2016 6:06 pm

You should have a
Code: Select all
oo_.SmoothedVariables.yobs(

somewhere. In your reconstruction, you are using the level of y. But in
Code: Select all
100*( log(y / y(-1)) + log(gammaz) - log(gammazss))

you have the logarithm of y.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 14 guests