RBC model with two states, two controls and borrowing constraint

Hi all,

I am trying to solve the firms recursive problem from Jermann and Quadrini (2012) where the firm is subject to a borrowing constraint. The firms problem can be written:

I am trying to modify the basic RBC example code. I have created a grid for d,n,k’ and b’ but am struggling with setting up the return function. I am putting in the two constraints and returning F=d as appears to happen in the RBC code. I have modified the return function to be written:

function F=BasicRealBusinessCycleModel_ReturnFn(d_val1,d_val2,a1prime_val,a2prime_val,a_val1,a_val2,xi_val,ws,R)

d_val1 + Params.kappa*(d_val1-ds)^2 = (a_val1^Params.theta)*(d_val2^(1-Params.theta))-a1prime_val+(1-Params.delta)a_val1-wsd_val2+a2prime_val./(R)-a1prime_val;

(a_val1^Params.theta)d_val2^(1-Params.theta) = xi(a2prime_val-a1prime_val./(R));

F=d_val1;

end

using the parameters defined in the problem. But I feel I am on the wrong track as I don’t see how my return function can recover d from my constraints. Is there a clear way I can solve this problem with the toolkit.

P.S. I have a SDF m’ in my problem which may cause a problem but I’m happy to use a constant discount factor in the firms problem if that is easier to solve.

Kind regards
Niall

1 Like

Is your interest specifically the model of Jermann & Quadrini (2012)? If so, this model is better solved with Dynare. You can find replication codes by Johannes Pfeifer at: DSGE_mod/Jermann_Quadrini_2012 at master · JohannesPfeifer/DSGE_mod · GitHub [includes a pdf of typos in the original article]

[If you are not specifically interested in Jermann & Quadrini (2012), but more generally in how to do something with VFI Toolkit let me know and I will reply again.]

2 Likes

Thank you Robert.

My problem is more general than just a replication exercise as I’m interested in seeing any dynamic programming problem solved with two or more control and state variables (granted not many more than two).

I have replicated Jermann and Quadrini (2012) in Dynare using first order perturbation. But I understand this only works under the assumption that the enforcement constraint (2) always binds (the assumption in Jermann and Quadrini (2012)). I have used the OccBin command in Dynare so that I can have the constraint not bind in the steady state however this only works to first order perturbation.

As an extension (slightly) I want to solve the model using value function iteration so I can have the constraint only occasionally binding but not have the restriction of OccBin being only perturbation to a first order.

I think my issue is setting up the return function (appreciate this is the hardest part) because I have additional constraints and two control variables in the firms problem.

I may be misinterpreting my problem so please let me know if anything glaringly doesn’t make sense.

Kind regards
Niall

1 Like

Just to note that Jermann and Quadrini do solve their model using global methods in a robustness exercise. The method used seems to be parameterized expectations PEA (i.e. they parametrize the conditional expectation function using a low order polynomial). I read the paper a while ago, so please check me :slight_smile:

1 Like

Yes, the limitation of Dynare is that you have to assume that the collateral constraint is always binding, which is not true, especially if you are not close to the steady-state. It’s actually quite interesting to solve these models using non-perturbation based methods.

Besides the vfi toolkit (which should work well in this case, if you don’t use very large grids) you might find useful to consult Christiano and Fisher 2000.

1 Like

Sounds like you know what you are doing and know why you want VFI instead of Dynare :slight_smile:

If I read the problem correct you use the right endogenous grids: k and b
But then notice that in the first equation
(1-\delta)k + F(z,k,n) -wn + \frac{b'}{R} = b + \varphi(d) + k'
if you have k,b,k' and b', then when you choose one of n and d, the equation is implicitly telling you want the other one of d and n must be.
So you just want one decision variable, I will use n, and then you just rearrange that equation to get d in terms of the rest, so inside the return function you will have
d=\varphi^{-1} ((1-\delta)k + F(z,k,n) -wn + \frac{b'}{R} -b - k')

The inputs the the return fn are then: (n,kprime,bprime,k,b,…)
n is a decision variable
k and b are endogenous states

Note: What is being done above can be kind of related to, say, how to solve the Aiyagari model with VFI Toolkit. You can think of household in Aiyagari as choosing c & k’ given k & z. But the way the toolkit works you just use the return fn with (kprime,k,a,…) and then can use the budget constraint to calculate c inside the budget constraint. In principle c is something being chosen, but the toolkit likes you to minimize the number of decision and state variables, and then any ‘residual’ decisions like consumption in Aiyagari are simply computed inside the return fn based on equations that pin them down given the more minimal decision and state variables.

[I don’t quite follow what s is in the equations you wrote as it does not appear in the rest of the equations.]

[VFI Toolkit won’t be able to do the stochastic discount factor]

2 Likes

@Niall If you are not interested in replicating Jermann and Quadrini (2012) very closely, you can make the simplifying assumption that

\varphi(d) = d

and write the budget constraint of the firm as

d = (1-\delta) k+F(z,k,n)-wn - k^\prime+\dfrac{b^\prime}{R}-b
As far as I remember, \varphi(d) incorporates a quadratic term to smooth out dividend payments. This is done to better match some financial moments in the data, but it is not essential for the model.

Moreover, can you precompute analytically the optimal level of labor demand n ? If so, you don’t have to include n as a decision variable. However, n enters in the collateral constraint, so I’m not sure.

1 Like