# Properly inserting the exogenous process in the model

Hi all,

This is somehow related to an older post of mine. I have a two-sector, two-country model that is calibrated. The exogenous process is the TFP in each sector and each country, hence I have four shocks and four exogenous variables.

``````zT1 = A1T_11*zT1(-1) + A1T_12*zT2(-1) + A1T_13*zN1(-1) + A1T_14*zN2(-1) + eT1 ;
zT2 = A2T_11*zT1(-1) + A2T_12*zT2(-1) + A2T_13*zN1(-1) + A2T_14*zN2(-1) + eT2 ;
zN1 = A1N_11*zT1(-1) + A1N_12*zT2(-1) + A1N_13*zN1(-1) + A1N_14*zN2(-1) + eN1 ;
zN2 = A2N_11*zT1(-1) + A2N_12*zT2(-1) + A2N_13*zN1(-1) + A2N_14*zN2(-1) + eN2 ;``````

where 1 and 2 are countries and T and N are sectors. I estimate the persistence parameters and the variance-covariance matrix outside the model and then I calibrate the values when running the model in Dynare (stoch_simul). To do the estimations, I extract Solow residuals as: ln(Z_ij) = ln(Y_ij) - (1-alpha)*ln(N_ij) for each country i = {1,2} ans sector j = {T, N}, where Y is output and N is hours. Here I emphasise that I perform the estimations in logs!

I want to have a log-linearised model, and I let Dynare do it. Thus, I insert the equations into my model as follows:

``````model;
zT1 = A1T_11*zT1(-1) + A1T_12*zT2(-1) + A1T_13*zN1(-1) + A1T_14*zN2(-1) + eT1 ;
zT2 = A2T_11*zT1(-1) + A2T_12*zT2(-1) + A2T_13*zN1(-1) + A2T_14*zN2(-1) + eT2 ;
zN1 = A1N_11*zT1(-1) + A1N_12*zT2(-1) + A1N_13*zN1(-1) + A1N_14*zN2(-1) + eN1 ;
zN2 = A2N_11*zT1(-1) + A2N_12*zT2(-1) + A2N_13*zN1(-1) + A2N_14*zN2(-1) + eN2 ;

.....

% Output
exp(yT_I1) = exp(zT1)*exp(ST1)^alphaT_1*exp(nT1)^(1-alphaT_1) ;
exp(yT_I2) = exp(zT2)*exp(ST2)^alphaT_2*exp(nT2)^(1-alphaT_2) ;
exp(yN1)   = exp(zN1)*exp(SN1)^alphaN_1*exp(nN1)^(1-alphaN_1) ;
exp(yN2)   = exp(zN2)*exp(SN2)^alphaN_2*exp(nN2)^(1-alphaN_2) ;

....

end;``````

Is that the correct way?? From reading J. Pfeiffer’s guide on observation equations it seems to be ok. But is it also ok that the Solow residuals were defined/estimated in logs? Again here I want to emphasise that I do not have exp(Z.,.) but " just" Z.,. in levels in defining the exogenous process in the Dynare code. And what does that mean on how my equations appear “on paper”, i.e. output is [ul]Y = exp(Z)K^alpha * N^(1-alpha) [/ul] or [ul]Y = ZK^alpha * N^(1-alpha) [/ul] (and what’s the difference…?)

Thanks in advance and sorry if some questions seem primitive.

Best,
Kyriacos

When you mean you want Dynare to log-linearize your model, do you want to use an exp()-substitution or use Dynare’s `loglinear` option? I presume the it is the former.

From what I can see, everything is correct. By specifying

you effectively define all variables of the logarithms corresponding to the same equation in levels

In the first equation, zT1 is therefore the logarithm of the TFP level, whose law of motion is given by

Both this LOM and your estimation were done in logs. Therfore, you should be fine.

Thanks for your reply. No, I do not use the log-linear option. I exp(.). At the end, the stoch_simul command is:

I guess it is still fine…? Btw, what is the difference between the exp(.) and the loglinear option? And when I use exp(.), the reported results (correlations, variances, … ) concern the variables in logs, in deviation from the steady-state? As in log(y) - log(y_bar)?

Thanks again!

Kyriacos

With

Dynare would automatically conduct the Jacobian transformation, i.e. you would not need to do the exp()-substitution.

The moments displayed by Dynare are always for the level of the variables you define. In

it will for example refer to the level of yT_I1. But as this variable is already the log of output, it is exactly what you want: the moment of log output.