Differences between revisions 5 and 6
Revision 5 as of 2010-04-15 14:40:43
Size: 4001
Comment: Correcting errors in the previous version
Revision 6 as of 2010-09-30 13:52:47
Size: 4760
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= Automatic removing of trends =
Line 9: Line 7:
== First case: exogenous nonstationary process == = Example =

== Original model ==

Consider a model with two trends: a labor productivity trend <<latex($A_t$)>> and a nominal price trend <<latex($P_t$)>>.

The model is the following (some equations are omitted):
Line 12: Line 17:
y_t &=& A_t k_{t-1}^\alpha\\ Y_t &=& (A_t L_t)^\alpha K_{t-1}^\beta \\
Line 14: Line 19:
g_t &=& \rho\, g_{t-1}+e_t g_t &=& \rho\, g_{t-1}+e_t\\
P_t\,C_t &=& W_t\, L_t\\
P_t &=& (1+\pi_t) P_{t-1}\\
r_t &=& \rho (\pi_t - \bar{\pi}) \\
Y_t &=& C_t + I_t\\
K_t &=& (1-\delta)K_{t-1} + I_t^\frac{1}{\alpha+\beta}
Line 18: Line 28:
Assuming that <<latex($y_t$)>> and <<latex($k_t$)>> have common trend <<latex($A_t$)>>, the stationarizing procedure calls for dividing first and second equation by <<latex($A_t$)>>. The second equation becomes meaningless and corresponds to the fact that <<latex($A_t$)>> doesn't belong to the stationary model. Some equations have been omitted.
Line 20: Line 30:
== Second case: endogenous nonstationary process == == Stationarized model ==

We define stationarized variables by <<latex($\hat{Y}_t = Y_t/A_t^{\alpha+\beta}$)>>, <<latex($\hat{C}_t = C_t/A_t^{\alpha+\beta}$)>>, <<latex($\hat{I}_t = I_t/A_t^{\alpha+\beta}$)>>, <<latex($\hat{K}_t = K_t/A_t$)>>, <<latex($\hat{W}_t = W_t/(P_t A_t^{\alpha+\beta})$)>>.

The equations of the stationarized model are:
Line 23: Line 37:
P_t\,C_t &=& W_t\, L_t\\
P_t &=& (1+\pi_t) P_{t-1}\\
r_t &=& \rho_1 (\pi_t - \bar \pi)
\hat{Y}_t &=& L_t^\alpha (\hat{K}_{t-1}/(1+g_t))^\beta\\
g_t &=& \rho\, g_{t-1}+e_t \\
\hat{C}_t &=& \hat{W}_t\, L_t\\
r_t &=& \rho (\pi_t - \bar \pi) \\
\hat{Y}_t &=& \hat{C}_t + \hat{I}_t \\
K_t &=& (1-\delta)K_{t-1}+I_t
Line 28: Line 45:
In this case as well, the second equation becomes meaningless after stationarizing the model.
Line 30: Line 46:
== Interface specification and usage ==
 * the user lists only the variables to be stationarized, but not the trend in the VAR statement
=== Specification of the trends ===
For each sochastic trend, the user lists the growth factor of the stochastic trend in parentheses and the list of variables following that trend. The growth factor is function of parameters and (stationary) variables of the model:
Note that the two trends <<latex($A_t$)>> and <<latex($P_t$)>> have disappeared from the model, along with their law of motions.

== Dynare syntax ==

Here is the proposed syntax for writing the original (non-stationary) model in Dynare:
Line 35: Line 53:
trend (exp(g)), C, K;
trend (exp(m-g)), P;
trend (exp(m)), W, D;
var Y, L, K, g, C, W, pie, r, I;
trend_var A, P;
varexo e;
parameters alpha, beta, delta, rho, piebar;

trends;
A, (1+g), K;
A^(alpha+beta), (1+g)^(alpha+beta), Y, C, I;
P*A^(alpha+beta), (1+pie)*(1+g)^(alpha+beta), W;
end;

model;
Y = (A*L)^alpha*K(-1)^beta;
g =rho*g(-1)+e;
P*C=W*L;
r =rho*(pie - piebar);
Y=C+I;
K=(1-delta)*K(-1)+I^(1/(alpha+beta));
//... and the last 3 equations
end;
Line 39: Line 74:
 * Note 1: one variable can't follow several trends (our trends are not the common trends of cointegration analysis).
 * Note 2: the preprocessor attaches its trend to each variable
=== Algorithm of transformation and test ===
 * The algorithm is performed after introduction of auxiliary variables to reduce leads and lags over multiple periods.
  * for each equation, in a temporary copy of the tree of this equation:
    1. each variables is multiplied by its trend (this trend is not a declared variable).
       * keep a list of variables treated that way for the test below
       *If the variabe appears with a lead, in addition, it is multiplied by the growth factor of the trend pushed forward by one period
       *
If the variable appears with a lag, in addition it is divided by the growth factor at the current period
    2. test: evaluate the derivative of the equation with respect to each of the trend variable introduced above. If the derivative is not null, the equation or the specification of trend for each variable is not compatible with balanced growth. Send an error message identifying the equation and the list of nonstationary variables affected by the faulty trend
    3. write the equation on the model tree, removing the trend variables.
  * question: should we change the name of the variable when stationarized? It would be clearer, but more complicated as well. The user would have to use the modified name of the variable in all subsequent instructions and we would have to keep two lists of variable names. So I think that we should keep the same names.
  * the transformation is triggered by the keyword {{{stationarize_model;}}}
   *
When the user wants to estimate the model in level, the nonstationary variables must be linked to the stationarized variable via (log-)linear relations:

Remarks:
* The trends are not declared as endogenous variables, but are attributed a new type.
 * In the {{{trends}}} block, the user has to specify both the expression used to detrend a given endogenous, then the growth factor of the same expression, followed by the corresponding variables.
 * The law of motion of trends in not in the {{{model}}} block (actually the same information is embedded in the {{{trends}}} block)

== Algorithm of transformation and test ==
  * The algorithm is performed after introduction of auxiliary variables to reduce leads and lags over multiple periods.
  * For each equation, in a temporary copy of the tree of this equation:
    1. each variables appearing in the {{{trends}}} block is multiplied by the expression declared in first position of the {{{trends}}} block
      * If the variabe appears with a lead, in addition, it is multiplied by the growth factor of the trend pushed forward by one period
      * If the variable appears with a lag, in addition it is divided by the growth factor at the current period
    2. Test: evaluate the derivative of the equation with respect to each of the {{{trend_var}}} variables introduced above. If the derivative is not null, the equation or the specification of trend for each variable is not compatible with balanced growth. Send an error message identifying the equation and the list of nonstationary variables affected by the faulty trend
    3. write the equation on the model tree, replacing all {{{trend_var}}} variables by the value {{{1}}}.
  * Question: should we change the name of the variable when stationarized? It would be clearer, but more complicated as well. The user would have to use the modified name of the variable in all subsequent instructions and we would have to keep two lists of variable names. So I think that we should keep the same names.
  * When the user wants to estimate the model in level, the nonstationary variables must be linked to the stationarized variable via (log-)linear relations:

Stationarizing a non-linear model by hand is a tedious process that is better done by the computer.

Computing the equilibrium growth rates of a balanced growth model is complicated and will not be attempted here. We limit ourselves to replace non-stationary variables by their stationary counterpart as specified by the user.

Current restriction: for the time being we limit ourselves to stochastic trends integrated of order 1.

Example

Original model

Consider a model with two trends: a labor productivity trend $A_t$ and a nominal price trend $P_t$.

The model is the following (some equations are omitted):

\begin{eqnarray*}
Y_t &=& (A_t L_t)^\alpha K_{t-1}^\beta \\
A_t &=& (1+g_t)A_{t-1}\\
g_t &=& \rho\, g_{t-1}+e_t\\
P_t\,C_t &=& W_t\, L_t\\
P_t &=& (1+\pi_t) P_{t-1}\\
r_t &=& \rho (\pi_t - \bar{\pi}) \\
Y_t &=& C_t + I_t\\
K_t &=& (1-\delta)K_{t-1} + I_t^\frac{1}{\alpha+\beta}
\end{eqnarray*}

Some equations have been omitted.

Stationarized model

We define stationarized variables by $\hat{Y}_t = Y_t/A_t^{\alpha+\beta}$, $\hat{C}_t = C_t/A_t^{\alpha+\beta}$, $\hat{I}_t = I_t/A_t^{\alpha+\beta}$, $\hat{K}_t = K_t/A_t$, $\hat{W}_t = W_t/(P_t A_t^{\alpha+\beta})$.

The equations of the stationarized model are:

\begin{eqnarray*}
\hat{Y}_t &=& L_t^\alpha (\hat{K}_{t-1}/(1+g_t))^\beta\\
g_t &=& \rho\, g_{t-1}+e_t \\
\hat{C}_t &=& \hat{W}_t\, L_t\\
r_t &=& \rho (\pi_t - \bar \pi) \\
\hat{Y}_t &=& \hat{C}_t + \hat{I}_t \\
K_t &=& (1-\delta)K_{t-1}+I_t
\end{eqnarray*}

Note that the two trends $A_t$ and $P_t$ have disappeared from the model, along with their law of motions.

Dynare syntax

Here is the proposed syntax for writing the original (non-stationary) model in Dynare:

var Y, L, K, g, C, W, pie, r, I;
trend_var A, P;
varexo e;
parameters alpha, beta, delta, rho, piebar;

trends;
A, (1+g), K;
A^(alpha+beta), (1+g)^(alpha+beta), Y, C, I;
P*A^(alpha+beta), (1+pie)*(1+g)^(alpha+beta), W;
end;

model;
Y = (A*L)^alpha*K(-1)^beta;
g =rho*g(-1)+e;
P*C=W*L;
r =rho*(pie - piebar);
Y=C+I;
K=(1-delta)*K(-1)+I^(1/(alpha+beta));
//... and the last 3 equations
end;

Remarks:

  • The trends are not declared as endogenous variables, but are attributed a new type.
  • In the trends block, the user has to specify both the expression used to detrend a given endogenous, then the growth factor of the same expression, followed by the corresponding variables.

  • The law of motion of trends in not in the model block (actually the same information is embedded in the trends block)

Algorithm of transformation and test

  • The algorithm is performed after introduction of auxiliary variables to reduce leads and lags over multiple periods.
  • For each equation, in a temporary copy of the tree of this equation:
    1. each variables appearing in the trends block is multiplied by the expression declared in first position of the trends block

      • If the variabe appears with a lead, in addition, it is multiplied by the growth factor of the trend pushed forward by one period
      • If the variable appears with a lag, in addition it is divided by the growth factor at the current period
    2. Test: evaluate the derivative of the equation with respect to each of the trend_var variables introduced above. If the derivative is not null, the equation or the specification of trend for each variable is not compatible with balanced growth. Send an error message identifying the equation and the list of nonstationary variables affected by the faulty trend

    3. write the equation on the model tree, replacing all trend_var variables by the value 1.

  • Question: should we change the name of the variable when stationarized? It would be clearer, but more complicated as well. The user would have to use the modified name of the variable in all subsequent instructions and we would have to keep two lists of variable names. So I think that we should keep the same names.
  • When the user wants to estimate the model in level, the nonstationary variables must be linked to the stationarized variable via (log-)linear relations:

\[
Pobs_t/Pobs_{t-1} = (P_t/P_{t-1})exp(\pi)\\  
\]

where P is the stationarized price level. In that case, variable Pobs shouldn't be listed in a trend expression, but only P and the original equation

Pobs/Pobs(-1)=P/P(-1);

shall be transformed in

Pobs/Pobs(-1)=P/P(-1)*exp(pie);

assuming that we have

trend (exp(pie)), P;

DynareWiki: RemovingTrends (last edited 2021-04-06 10:18:41 by JohannesPfeifer)