Representative agent with labor income

Dear all,

I am trying to code up a representative agent with the recursive preferences and labor income in an endowment economy.

I wrote down the setup in a latex form here : https://www.dropbox.com/s/s5i5w2qr279r04l/model.pdf?dl=0

I don’t know how to code to compute the endogenous equity returns and equity volatility.

Here is my code.

var V S s d y c pi_e pi_b E_t_R_e R_f sigma_e e_y rho E_t_SDF_plus_1;

varexo e_d e_yy

parameters mu_d sigma_d mu_y sigma_y beta gamma psi 

mu_d = 0.01;
sigma_d = 0.0705;
mu_y = 0.02;
sigma_y = 0.08;
beta = 0.975;
gamma = 8;
psi = 1.5;
rho = 0; 

model;
#theta = (1 - gamma)/(1 - (1/psi));
// Generate a correlated shock
e_y = rho*e_d+sqrt(1-rho^2)*e_yy; 

// Define Value function
V = ((1-beta)*c^((1-gamma)/theta) + beta*s^(1/theta))^(theta/(1-gamma));`

// Define an auxiliary variable s that captures E_t[V(+1)^sigma]
s = V(+1)^(1-gamma);

// Euler equation for equity
1 = beta*((V(+1)^(1-gamma))/s)^(1-(1/theta))*(c(+1)/c)^(-1/psi)*(S(+1)+exp(d(+1)))/S;

// Expectation of SDF
E_t_SDF_plus_1 = beta*((V(+1)^(1-gamma))/s)^(1-(1/theta))*(c(+1)/c)^(-1/psi);

//define gross risk-free rate
R_f = 1/E_t_SDF_plus_1;

//define gross return to equity
E_t_R_e = (S(+1)+exp(d(+1)))/S;

//Budget constraint with clearing condition
c = exp(d)+exp(y);

// Law of motion of log dividend
d = d(-1) + mu_d + sigma_d*e_d;

// Law of motion of log labor
y = y(-1) + mu_y + sigma_y*e_y;
end;


steady_state_model
V=c;
s = V^(1-gamma);
E_t_SDF_plus_1 = beta;
E_t_R_e = 1/beta;
R_f=1/E_t_SDF_plus_1;
end;

steady;
check;

shocks;
var e_d; stderr 1;
var e_yy; stderr 1;
end;

%% get second order decision rules
stoch_simul(order=2,periods=100000,drop=1000,irf=0) V S s d y c pi_e pi_b E_t_R_e R_f sigma_e e_y rho E_t_SDF_plus_1;

Did you have a look at https://github.com/JohannesPfeifer/DSGE_mod/blob/master/Jermann_1998/Jermann_1998.mod

Dear Professor Pfeifer,

Thank you for your reply, I looked at your replication for Jermann 1998.

My issue is different from the production economy, I don’t have a equation for the expected equity returns (which is [name=‘Return to capital’]
r_k=1/q*(alphaexp(z(+1))k(+1)^(alpha-1)+q(+1)(1-delta+const+ba/(1-a)*(invest(+1)/k(+1))^(1-a))); in Jermann 1998 code).

Maybe it is okay not to have this equation and I can compute the realized mean using the simulated endogenous stock price process. Is it correct?

Also, I have to write down the steady state level of c, which is simply the sum of dividend and labor income.

But then, what should be the stead state levels for dividend and labor income.

In my case, log(D_{t+1}/D_{t}) = mu_d + sigma_d * epsilon.

So, in the steady state, the LHS is zero and the RHS is mu.

If I model the following process, I don’t have such a issue although this is not typically how the dividend process has been modeled in the finance asset pricing literature:

log(D_{t+1}) = rho * log(D_t) +mu_d +sigma_d * epsilon.

Then, log(D_ss) = mu_d / (1-rho)

I used the following code, ignoring the above issue, I simply used the initial values of dividend and labor income as steady state levels, but I got an error message “The steadystate file did not compute the steady state”. Could you please give me some hint?

var V S s d y c R_f e_y E_t_SDF_plus_1;

varexo e_d e_yy;

parameters mu_d sigma_d mu_y sigma_y beta gamma psi rho;

mu_d = 0.01;
sigma_d = 0.0705;
mu_y = 0.02;
sigma_y = 0.08;
beta = 0.975;
gamma = 8;
psi = 1.5;
rho = 0; 

model;
#theta = (1 - gamma)/(1 - (1/psi));

// Generate a correlated shock

e_y = rho*e_d+sqrt(1-rho^2)*e_yy; 

// Define Value function
V = ((1-beta)*(c)^((1-gamma)/theta) + beta*s^(1/theta))^(theta/(1-gamma));

// Define an auxiliary variable s that captures E_t[V(+1)^sigma]
s = V(+1)^(1-gamma);

// Euler equation for equity
1 = beta*((V(+1)^(1-gamma))/s)^(1-(1/theta))*(c(+1)/c)^(-1/psi)*(S(+1)+exp(d(+1)))/S;

// Expectation of SDF
E_t_SDF_plus_1 = beta*((V(+1)^(1-gamma))/s)^(1-(1/theta))*(c(+1)/c)^(-1/psi);

//define gross risk-free rate
R_f = 1/E_t_SDF_plus_1;


// Law of motion of log dividend
d = d(-1) + mu_d + sigma_d*e_d;

// Law of motion of log labor
y = y(-1) + mu_y + sigma_y*e_y;

c = exp(d)+exp(y);
end;

steady_state_model;
d = log(0.05);
y = log(1);
c = exp(d)+exp(y);
V=c;
s = V^(1-gamma);
E_t_SDF_plus_1 = beta;
R_f=1/E_t_SDF_plus_1;
S = exp(d)/(1/beta-1);
e_y = 0;
end;

initval;
d = log(0.05);
y = log(1);
end;


steady;
check;

shocks;
var e_d; stderr 1;
var e_yy; stderr 1;
end;

%% get second order decision rules
stoch_simul(order=2,periods=100000,drop=1000,irf=0) V S s d y c R_f e_y E_t_SDF_plus_1;

I am not sure I am following. You seem to have a model with growth in mind. In this case you need to appropriately detrend the model first, before you work with it in Dynare.