Differences between revisions 9 and 10
Revision 9 as of 2010-10-11 13:47:19
Size: 5736
Comment:
Revision 10 as of 2010-10-15 10:25:46
Size: 4427
Comment:
Deletions are marked like this. Additions are marked like this.
Line 48: Line 48:
Here are the proposed syntax for writing the original (non-stationary) model in Dynare:

=== Proposal 1 ===
Here is the proposed syntax for writing the original (non-stationary) model in Dynare:
Line 53: Line 51:
var Y, L, K, g, C, W, pie, r, I;
trend_var A, P;
var g, pie;
trend_var(growth_factor=1+g) A
trend_var(growth_factor=1+pie) P;
parameters alpha, beta, delta, rho, piebar;
var L, r;
var(deflator=A) K;
var(deflator=A^(alpha+beta)) Y C I;
var(deflator=P*A^(alpha+beta)) W;
Line 56: Line 60:
parameters alpha, beta, delta, rho, piebar;

trends;
K: deflator=A, growth_factor=(1+g);
Y, C, I: deflator=A^(alpha+beta), growth_factor=(1+g)^(alpha+beta);
W: deflator=P*A^(alpha+beta), growth_factor=(1+pie)*(1+g)^(alpha+beta);
end;
Line 77: Line 74:
 * 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)

=== Proposal 2 ===

{{{
trend_var A, P;
parameters alpha, beta, delta, rho, piebar;
var L, g, pie, r;
var(trend_deflator=A, trend_growth_factor=(1+g)) K;
var(trend_deflator=A^(alpha+beta), trend_growth_factor=(1+g)^(alpha+beta)) Y C I;
var(trend_deflator=P*A^(alpha+beta), trend_growth_factor=(1+pie)*(1+g)^(alpha+beta)) W;
varexo e;

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;
}}}

Note that the order of declaration matters: the trend vars and some endogenous
and parameters must be declared before the detrended variables.
 * The order of declaration matters: the trend vars and some endogenous and parameters must be declared before the detrended variables.
Line 106: Line 77:
  * 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: for all model equations <<latex($F(\ldots)=0$)>>, all trend variables <<latex($A_{i,t}$)>> and all dynamic endogenous variables <<latex($y_{j,t+k}$)>>, check that <<latex($\frac{\partial^2 \log F}{\partial A_{i,t}\partial y_{j,t+k}}=0$)>> (by evaluating the derivative at some point, typically the values given in {{{initval}}}). If any of the cross-derivatives 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:
{{{#!latex
\[
Pobs_t/Pobs_{t-1} = (P_t/P_{t-1})exp(\pi)\\
\]
  * The algorithm is performed before introduction of auxiliary variables (because the preprocessor cannot guess the trends of auxiliary variables).
  * Each detrended variable is replaced by itseft times its deflator (leading or lagging the deflator if the variable is itself leaded or lagged)
  * Then each leaded or lagged trend variable (declared with {{{trend_var}}}) is shifted to current period (by multiplying or dividing by the growth factor)
  * A test is performed to check that the trends are compatible with balanced growth:
    * For all model equations <<latex($F(\ldots)=0$)>>, all trend variables <<latex($A_{i,t}$)>> and all dynamic endogenous variables <<latex($y_{j,t+k}$)>>, check that <<latex($\frac{\partial^2 \log F}{\partial A_{i,t}\partial y_{j,t+k}}=0$)>> (by evaluating the derivative at some point, typically the values given in {{{initval}}}, but possibly other random points)
    * If any of the cross-derivatives is not null, the equation or the specification of trend for each variable is not compatible with balanced growth. Exit with an error message identifying the equation and the list of nonstationary variables affected by the faulty trend
  * If the test passed, replace trend variables ({{{trend_var}}} variables) by the value {{{1}}}.
  * When the user wants to estimate the model in level, the user needs to introduce observed variables in level, but these should not be declared in {{{trend_var}}} nor be declared with a deflator.and not nonstationary variables must be linked to the stationarized variable via (log-)linear relations. For example, if {{{Pobs}}} is the observed price level, it should be a standard endogenous, with the equation:
{{{
Pobs/Pobs(-1)=pie;
Line 120: Line 88:
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 And the trend must be declared with the {{{trend}}} keyword used for estimation:
Line 122: Line 90:
Pobs/Pobs(-1)=P/P(-1); trend (pie), P;
Line 124: Line 92:
shall be transformed in
{{{
Pobs/Pobs(-1)=P/P(-1)*exp(pie);
}}}
assuming that we have
{{{
trend (exp(pie)), P;
}}}

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*}

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 \\
\hat{K}_t &=& (1-\delta)\hat{K}_{t-1}+\hat{I}_t
\end{eqnarray*}

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

Dynare syntax

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

var g, pie;
trend_var(growth_factor=1+g) A
trend_var(growth_factor=1+pie) P;
parameters alpha, beta, delta, rho, piebar;
var L, r;
var(deflator=A) K;
var(deflator=A^(alpha+beta)) Y C I;
var(deflator=P*A^(alpha+beta)) W;
varexo e;

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.
  • The order of declaration matters: the trend vars and some endogenous and parameters must be declared before the detrended variables.

Algorithm of transformation and test

  • The algorithm is performed before introduction of auxiliary variables (because the preprocessor cannot guess the trends of auxiliary variables).
  • Each detrended variable is replaced by itseft times its deflator (leading or lagging the deflator if the variable is itself leaded or lagged)
  • Then each leaded or lagged trend variable (declared with trend_var) is shifted to current period (by multiplying or dividing by the growth factor)

  • A test is performed to check that the trends are compatible with balanced growth:
    • For all model equations $F(\ldots)=0$, all trend variables $A_{i,t}$ and all dynamic endogenous variables $y_{j,t+k}$, check that $\frac{\partial^2 \log F}{\partial A_{i,t}\partial y_{j,t+k}}=0$ (by evaluating the derivative at some point, typically the values given in initval, but possibly other random points)

    • If any of the cross-derivatives is not null, the equation or the specification of trend for each variable is not compatible with balanced growth. Exit with an error message identifying the equation and the list of nonstationary variables affected by the faulty trend
  • If the test passed, replace trend variables (trend_var variables) by the value 1.

  • When the user wants to estimate the model in level, the user needs to introduce observed variables in level, but these should not be declared in trend_var nor be declared with a deflator.and not nonstationary variables must be linked to the stationarized variable via (log-)linear relations. For example, if Pobs is the observed price level, it should be a standard endogenous, with the equation:

Pobs/Pobs(-1)=pie;

And the trend must be declared with the trend keyword used for estimation:

trend (pie), P;

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