Linearisation and log-linearisation, in Dynare and by hand

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.

Linearisation and log-linearisation, in Dynare and by hand

Postby kyri82 » Sun May 04, 2014 5:33 pm

Hi all,

I have my model for which I solve the steady-state by hand and I also log-linearise by hand. I wanted to let Dynare do the linearisation to see if it gives me the same results but this is not the case. There are two things:

1. Differences in terms of unconditional correlations across the two models, the one that I introduce in log-linear form in Dynare and the one that I let Dynare do so are sometimes quite substantial. In both cases, I use resid(1) and all the residuals of the static model are nill, suggesting that the steady-state is well defined.

2. When I let Dynare on one hand to linearise the model, and on the other to log-linearise it, results are (almost) unchanged.

Am I doing something wrong to get such big discrepancies across the two models, which are supposed to give me the exact same solution? Thanks for any help/suggestions how I could verify/correct my results

Best,
K.
kyri82
 
Posts: 141
Joined: Thu Feb 10, 2011 6:14 pm
Location: Toulouse - France

Re: Linearisation and log-linearisation, in Dynare and by ha

Postby jpfeifer » Wed May 07, 2014 10:09 am

Could you provide the mod-files. What you describe should not happen. The results must be identical
------------
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: Linearisation and log-linearisation, in Dynare and by ha

Postby kyri82 » Thu May 08, 2014 5:37 pm

Hi jpfeifer,

Thanks for your response. I have to admit the model is a bit complicated, mostly big. I attach the relevant files. The commands before the model block are to calculate the steady state. For that it also uses the fsolve function attached in an additional file. The files are:
- BSnews: the one where I introduce the linear model.
- BSnewsNL: model's FOCs, Dynare does the linearisation.
- BSnewsNL1: model's FOCs, Dynare does the log-linearisation.
Note that all variables are followed by 1 and 2 as it is a two country model.

Some doubts I had in introducing the model's equations are the following:
- treatment of the adjustment cost functions (investment and utilisation) in the mod files that Dynare does the linearisation (variable names sI and sprimeI and deltaU and deltaprimeU).
- treatment of the exogenous (productivity) process. In particular, I assume a production function Y = Z*K^alpha*N^(1-alpha) and wondering whether it should be e^Z*K....

Thanks for your time and willingness to help.

Best,
K.
Attachments
myfunCapitalServices3.m
(1.35 KiB) Downloaded 60 times
BSnews.mod
(37.39 KiB) Downloaded 70 times
BSnewsNL1.mod
(33.42 KiB) Downloaded 68 times
BSnewsNL.mod
(37.07 KiB) Downloaded 60 times
kyri82
 
Posts: 141
Joined: Thu Feb 10, 2011 6:14 pm
Location: Toulouse - France

Re: Linearisation and log-linearisation, in Dynare and by ha

Postby jpfeifer » Mon May 12, 2014 2:56 pm

I am puzzled by the fact that
Code: Select all
% Intermediate goods production
yT_I1 = zT1 + alphaT_1*(ST1) + (1-alphaT_1)*nT1 ;
yT_I2 = zT2 + alphaT_2*(ST2) + (1-alphaT_2)*nT2 ;
yN1 = zN1 + alphaN_1*(SN1) + (1-alphaN_1)*nN1 ;
yN2 = zN2 + alphaN_2*(SN2) + (1-alphaN_2)*nN2 ;

in the lineariz model have a residual of -1 each and that the steady state seems to be not exactly 0 as it should be. There are also other equation with non-zero residuals that typically indicate small problems that remain.
------------
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: Linearisation and log-linearisation, in Dynare and by ha

Postby kyri82 » Mon May 12, 2014 3:14 pm

Hi,

Sorry, that was so stupid of me. In that version I left something open while I was experimenting to find a solution to the problem. In particular, and this might be a hint, I set the initial conditions on Z=1, for all of the Zs.

I am attatching again the corrected version of the files. These are same three files as before (same description) where the static model is solved without any apparent problem. Those linearised by Dynare (BSnewsNL and BSnewsNL1) offer almost identical results. The one I introduced in log-linear form myself (BSnews) produces different ones.

Can you please look it up again? Thanks!

Best,
K.
Attachments
BSnewsNL1.mod
(33.42 KiB) Downloaded 59 times
BSnewsNL.mod
(37.07 KiB) Downloaded 53 times
BSnews.mod
(37.39 KiB) Downloaded 66 times
kyri82
 
Posts: 141
Joined: Thu Feb 10, 2011 6:14 pm
Location: Toulouse - France

Re: Linearisation and log-linearisation, in Dynare and by ha

Postby kyri82 » Sun May 18, 2014 8:02 pm

Hi,

I was wondering weather you had any chance to have a look at my code. I actually noticed that in the cases where I let Dynare do the linearisation (simple or log) the variances of the langrange multipliers are huge; an obvious anomaly. Any idea what that might mean and where would that mean I should look for a mistake? Whats surprising is that all the other statistics - I even ask extra verifications than the ones Dynare does - look perfectly normal.

I am attaching again a version of the model (the one that I ask for simple linearisation), I discovered one mistake in the previous one.

Thanks a lot!

K.
Attachments
BSnewsNL_1.mod
(37.95 KiB) Downloaded 59 times
kyri82
 
Posts: 141
Joined: Thu Feb 10, 2011 6:14 pm
Location: Toulouse - France


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 6 guests