Equity Premium in Jermann 1998 and Otherwise

Dear all,

I have a few questions about replicating Jermann 1998, particularly in regards to the equity premium. A similar question was asked before on the Dynare forums (http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=5814) but there was no answer.

I have come across a mod file on the Dynare forum, and there are a few things that I don’t understand in the code. Please see the attached code for a reference. JermannUS.mod (1.5 KB)

First, I think there is a mistake in the attached code. The return on capital in the code is given as


However I think that this is missing a term: everything should be divided by q. Thus it should read:


Does this correction make sense? Once this correction is made, the “R” and the “return on equity” term give the same value, as I think they should.

However, post correction, the equity premium goes away! In fact, the return on equity is even lower than the risk free rate, i.e. there is a negative equity premium.

I do hope this was clear – if not please let me know.



Dear all,

For future reference, I have found a solution to my problem. On the other hand, I don’t understand why my solution works…

I was indeed correct – there was a mistake in the code, and everything should indeed have been divided by q.

For the second problem, I also found a solution to the “missing” equity premium. In fact, I was calculating the risk free rate incorrectly. As shown in the code above, i calculated the risk free rate as

rf = lambda/(beta*lambda(+1))

But this, for some reason, is incorrect! If I instead calculate it in two steps:

m = beta*lambda(+1)/lambda

rf = 1/m

It comes out with the correct solution!

Does anyone know why if you use “two steps” to calculate the risk free rate, rather than 1, it works?

Many thanks,


Dear Jake,

I didn’t look the mod file you are referring to or try to understand the issue in your opening post, but clearly here the problem is where you put the conditional expectation. Dynare applies the conditional expectation on the whole equation. So if you write something like:

x = 1/m(1);

Dynare reads:

x_t = \mathbb E\left [\frac{1}{m_{t+1}}\right]

while in your case you want:

x_t = \frac{1}{\mathbb E\left [m_{t+1}\right]}

which is quite different… To do that, or more generally to define a conditional expectation inside a nonlinear expression, you have to use an auxiliary variable. In the model block, you need to write instead something like:

z = m(1);
x = 1/z;

This is the rational for the fix you found yourself. As soon as the model is nonlinear, it is very important to be very carful how you write the equations in the mod file. Two equivalent expressions in a deterministic model can lead to very different outcomes in a stochastic model.


Many thanks Stéphane, it is all clear now.

@nemmerel I just uploaded a preliminary version to https://github.com/JohannesPfeifer/DSGE_mod/blob/master/Jermann_1998/Jermann_1998.mod

Dear Johannes,

I’ve taken a look at your code, and I have a question about a few of the equations. In particular,

[name='FOC capital']

I may very well be mistaken, but to me this doesn’t look quite right. The return on purchasing one unit of capital is the marginal product of capital next period, plus the remaining capital left over. Thus I believe the equation should read:


Alternatively, it can be written (to line up with some older code that is around on the internet, JermannUS.mod)


I haven’t tested the results of your code against the paper yet, but will look forward to doing so when I have some time.

All the best,


I think you are forgetting about the capital adjustment costs occurring, which affect the price of capital as well. But it may well be I did a mistake. I uploaded my algebra to https://github.com/JohannesPfeifer/DSGE_mod/blob/master/Jermann_1998/Jermann1998_Algebra.pdf
Any feedback is welcome.