Dear all,

I’m trying to build a model similar to Martinez-Miera, Repullo (2010) into Dynare. The model includes firms that can choose to undertake projects with different probabilities of success and banks that decide on a the amount of loans taking the effect on the lending rate and subsequently the firm’s risk choice into account.

The firm chooses an idiosyncratic risk level p(R^{L}_{t}, a_{t}) given the lending rate (R^{L}_{t} ) and technology shock (a_{t}). The aggregate success probability x depends in addition on an aggregate shock (“systemic risk shock”) that is normally distributed and creates correlation between otherwise uncorrelated projects.

Banks optimize over their choice of capital that they are willing to lend (L^{T}_{t}) taking into account how the interest rate changes with increased supply; i.e. the lending rate R_{t}^{L} is a function of L_{t}^{T}. In doing so they also take the effect of their choice on the aggregate project success probability into account. After some rewriting the bank’s profit, there is a term that integrates over the normal CDF of the aggregate productivity shock \int_{\hat{x}}^{1} F(x) dx .

Where F(x) reads:

F(p(L_{t}^{T}),x) = \Phi( \frac{\Phi^{-1}(1-p) + \sqrt(1-\rho)\Phi^{-1}(1-x)}{\sqrt(\rho)}

and \hat{x} is some cutoff value pinned down by another equation. So the distribution depends on the firm’s risk choice which in turn depends on the lending rate and thereby the banks choice L^{T}_{t}.

The question is whether Dynare can handle such a thing. I can evaluate the FOC for the banks profit for given values. But I have trouble making it work in Dynare. The integration does not work. Also given that no closed form for \Phi^{-1}(1-p) exists can Dynare do a first-order approximation of this?

Any help would be greatly appreciated.