Skip to content
This repository has been archived by the owner. It is now read-only.

Fix using steady state operator on exogenous variables #825

Open
JohannesPfeifer opened this issue Dec 13, 2014 · 10 comments

Comments

Projects
None yet
5 participants
@JohannesPfeifer
Copy link
Contributor

commented Dec 13, 2014

The mod-file

var c, h, pi, w, R, r_e, y, gdp, gdp_hat, k, g, w_tilde, w_eq, w_min;
varexo d, z, eta; 

parameters beta, sigma, gamma, theta, ni, tau_w, phi_p, phi_y, rho, alpha;

beta  = 0.997;
sigma = 1;
gamma = 458.4;
theta = 6.1;
tau_w = 0.2;
ni    = 0.28;
phi_p = 1.5;
phi_y = 0.125;
rho   = 0.3;
alpha = 0.064;

model;

w_tilde=rho/(1+pi)*w(-1)+(1-rho)*w_eq;
w_eq   =(1-alpha)*steady_state(z)*steady_state(h)^(-alpha);
w_min  =w(-1)/(1+pi);

//mrs=c^sigma*h^ni/(1-tau_w);

gdp_hat =log(gdp)-log(steady_state(gdp));

r_e=1/(beta*d(+1))-1;

//FOC labor
c^sigma*h^ni=max(w_tilde,w_min)*(1-tau_w);

//Euler equation 1
1=beta*d(+1)*(1+R)/(1+pi(+1))*(c/c(+1))^sigma;

//Euler equation 2
0=(1/(1-alpha))*max(w_tilde,w_min)/z*h^alpha-1-gamma/theta*pi*(1+pi)+beta*d(+1)*(c/c(+1))^sigma * y(+1)/y*gamma/theta*pi(+1)*(1+pi(+1));

// Taylor rule with ZLB
R=max(0,r_e+phi_p*pi+phi_y*gdp_hat);

//output
y=z*h^(1-alpha);

//aggregate resource constraint
c=(1-k-eta)*y;

// resource cost of price adjustment
k=(gamma/2)*(pi^2);

//government purchases
g=eta*y;

// GDP
gdp=(1-k)*y;

//utility
//u=(c^(1-sigma))/(1-sigma)-(h^(1+ni))/(1+ni);
end;

initval;
z=1;
d=1;
pi=0;
k=(gamma/2)*(pi^2);
r_e=1/(beta*d)-1;
h=1;
y=z*h^(1-alpha);
g=eta*y;
c=(1-k-eta)*y;
//w=z;
//w=(1-alpha)/(h^alpha);
gdp=(1-k)*y;
R=r_e;
eta=0.2;
end;

steady;
check;

uses steady_state(z) where z is an exogenous variable. In the _dynamic file, the preprocessor translates this to oo_.exo_steady_state(2) which does not exist in the _dynamic file, leading to a crash. We should either disallow using the steady state operator on exogenous variables or simply enforce that the steady state of exogenous variables is 0. I would prefer the first one as the second would only be viable for stochastic simulations.

@houtanb houtanb added the bug label Dec 15, 2014

@houtanb houtanb added this to the 4.5 milestone Dec 15, 2014

@stepan-a

This comment has been minimized.

Copy link
Member

commented Dec 15, 2014

@JohannesPfeifer I think that we should rather add an input argument to the dynamic routines. Instead of having:

function [residual, g1, g2, g3] = model_dynamic(y, x, params, steady_state, it_)

we should have something like

function [residual, g1, g2, g3] = model_dynamic(y, x, params, steady_state, steady_state_x, it_)

and then we should replace oo_.exo_steady_state(i) by steady_state_x(i). @houtanb Can you give an estimate of the time that you would need to implement this?

@houtanb houtanb self-assigned this Dec 15, 2014

@houtanb

This comment has been minimized.

Copy link
Member

commented Dec 15, 2014

@stepan-a not too long. I think there'll be more work on the matlab side....

@houtanb

This comment has been minimized.

Copy link
Member

commented Jan 14, 2015

preprocessor changes on exo_steady_state branch

@houtanb houtanb removed their assignment Jan 14, 2015

@stepan-a stepan-a added the decision label Jun 10, 2016

@houtanb houtanb self-assigned this Apr 21, 2017

@houtanb

This comment has been minimized.

Copy link
Member

commented Apr 21, 2017

Unreverted here: 3ea37bb

@houtanb

This comment has been minimized.

Copy link
Member

commented Apr 24, 2017

more changes on exo_steady_state branch. Remaining to be done: bytecode, block, k_order

Tests that fail outright:

|     * k_order_perturbation/fs2000k2_m.mod
|     * k_order_perturbation/fs2000k_1_m.mod
|     * k_order_perturbation/fs2000k3_m.mod
|     * k_order_perturbation/fs2000k3_p.mod
|     * decision_rules/third_order/FV2011.mod

Tests whose values differ from those expected:

|     * ramst_normcdf_and_friends.mod
|     * ep/linearmodel0.mod
@stepan-a

This comment has been minimized.

Copy link
Member

commented Apr 24, 2017

@houtanb I think that ramst_normcdf_and_friends.mod already fails in master branch.

@JohannesPfeifer

This comment has been minimized.

Copy link
Contributor Author

commented Apr 24, 2017

@stepan-a Exactly, I opened a ticket for that (#1439)

@houtanb

This comment has been minimized.

Copy link
Member

commented Sep 1, 2017

@MichelJuillard has agreed to look at the k-order portion of these changes

@houtanb

This comment has been minimized.

Copy link
Member

commented Sep 1, 2017

@FerhatMihoubi Also missing is support for block.

@houtanb

This comment has been minimized.

Copy link
Member

commented Sep 1, 2017

NB The changes to the rest of the code base can be found here: https://github.com/houtanb/dynare/tree/exo_steady_state

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.