Page 1 of 2

Optimal Monetary Policy with nonlinear loss function

PostPosted: Tue Dec 27, 2016 5:51 pm
by Beav
Good evening,

I am currently developing a ZLB, Neo-Keynesian model (Calvo pricing) of optimal monetary policy in which the Central Bank has a nonlinear target function. In particular, the loss function of the monetary agent has a LINEX form (Zellner, 1986) for what concerns the loss carried by deviations of the inflation rate from its socially optimal target.

The model is therefore quasi-standard as in Galì (2015), section 5.4.1, but for the "leaning against the wind condition", which is clearly nonlinear, given a non-quadratic loss. In fact, this looks like the following
Code: Select all
[name='FOC, eq. (33)']
vartheta*x=-kappa*(exp(alphha*pi)-1)/alphha-xi_2;
. The other equations are the loglinearised NKPC and IS curve. There is no Taylor rule, as I aim at finding the optimal monetary policy.

I have tried to solve this problem with the Levenberg-Marquardt mixed complementarity problem approach suggested by Prof. Johannes Pfeifer under another post in this forum, but I am not sure about the results. In particular, I wonder whether such a method makes me lose the nonlinearity, bringing me back to the standard, quadratic case, to which the equation would collapse if an approximation to the first order were to be taken.

I would very much appreciate any help I could get on the subject (feasibility, alternative ways or explanations), as I am really new with this topic.

Kind regards,


Edoardo

Re: Optimal Monetary Policy with nonlinear loss function

PostPosted: Wed Dec 28, 2016 7:03 pm
by jpfeifer
Dear Edoardo,
the
Code: Select all
lmmcp

solver is a perfect foresight solver which will honor all nonlinearities you embed. But from what you describe, it seems you are not simply solving a nonlinear equation system as I did in https://github.com/JohannesPfeifer/DSGE_mod/blob/master/Gali_2015/Gali_2015_chapter_5_commitment_ZLB.mod
If you are trying to use an optimal policy command in Dynare, things will become tricky.

Re: Optimal Monetary Policy with nonlinear loss function

PostPosted: Tue Jan 03, 2017 9:40 am
by Beav
Thank you so much for your reply!

Could you please expand a bit on why things could get tricky? Or if you could provide me with any reference, I shall be very happy to check them out myself!

Again, thank you so so much!

Re: Optimal Monetary Policy with nonlinear loss function

PostPosted: Sun Jan 08, 2017 10:01 am
by Beav
I have done my research and I see what you mean.

I am not looking for the optimal policy function, but nonetheless I am having trouble solving the System as you have done in the cited code, with the opportune modifications.

In particular, I am now running the latest version of Dynare in which the Homotopy approach works. The result of such method is "Failed to solve for the perfect foresight model", i.e. it does not find convergence (Although it produces a simulation which would go accordingly with my theory).

I have tried by reducing the size of the shock, but I think I do need a bigger one for it to have the desired effects. Therefore, I was wondering if anyone could suggest an alternative strategy (or again, provide a useful reference).

Thank you so much for your help!

Re: Optimal Monetary Policy with nonlinear loss function

PostPosted: Sun Jan 08, 2017 7:00 pm
by jpfeifer
Homotopy actually works by starting with a smaller shock size. Are there any steps during homotopy that actually work?

Re: Optimal Monetary Policy with nonlinear loss function

PostPosted: Mon Jan 09, 2017 5:07 pm
by Beav
Thank you for your reply!

For smaller shocks (up to a drop in real interest rate to -0.30 from the initial value of 1) the Homotopy Method does work, but there is no discernible difference with respect to the standard, quadratic model.

If I set a drop of the real interest rate to -1, however, the homotopy method continues for around 1300 steps with progressively increasing lambdas, but also increasing max residuals (in the order of e+04, which is really huge). Some of them succeed, some do not. In particular the first step (Lambda=0.5) has very small residuals, which makes it try for Lambda=1, from which the divergence starts.

I am not quite sure on how this residuals are being calculated, though. Maybe understanding how these residuals are being calculated is a first step towards understanding the nature of my issue.

Re: Optimal Monetary Policy with nonlinear loss function

PostPosted: Tue Jan 10, 2017 7:46 pm
by jpfeifer
Each equation at each point in time has a residual. What is displayed is the infinity norm (maximum absolute value) of these residuals. Are you sure that the nonlinear model has a solution with big shocks?

Re: Optimal Monetary Policy with nonlinear loss function

PostPosted: Wed Jan 11, 2017 12:43 pm
by Beav
Thank you very much for your reply.

In fact, I am not sure whether the model does have a solution for big shocks (it might be argued that a natural interest rate of -1 is not such a big shock, being the standard one used by Galì). That is what I was hoping to figure out.

Re: Optimal Monetary Policy with nonlinear loss function

PostPosted: Tue Jan 17, 2017 10:56 am
by jpfeifer
Unfortunately, that seems to be a very hard problem to debug. Have you tried providing the linear solution as an initial guess?

Re: Optimal Monetary Policy with nonlinear loss function

PostPosted: Wed Jan 18, 2017 2:24 pm
by Beav
Thanks for the reply.

That seems to be a good place to start. Do you mean setting the initial values of the simulation equal to the values of the solution after the shock?

Otherwise I was thinking about moving to another method, always within dynare, the most famous of which is probably OccBin by Iacoviello. However, I believe that it works only for linear models, as most other methods do.

Thank you so much for any help you can provide me!

Re: Optimal Monetary Policy with nonlinear loss function

PostPosted: Wed Jan 18, 2017 9:02 pm
by jpfeifer
Occbin does only work with linear models.

What I was suggesting is to solve the model without the constraint and save the solution from
Code: Select all
oo_.endo_simul
. Then run
Code: Select all
perfect_foresight_setup
with the constraint, load the previous results into
Code: Select all
oo_.endo_simul

and then run
Code: Select all
perfect_foresight_solver

Re: Optimal Monetary Policy with nonlinear loss function

PostPosted: Fri Jan 20, 2017 2:43 pm
by Beav
Thank you so much!

I will do that straight away and hopefully that will provide me some further answers.

I was thinking that maybe it would be appropriate to generate multiple simulations for different values of the key parameter and the key shock, showing where the model does get solved and where not. Is there any particular reference on how to implement such an analysis, by inserting a Dynare routine within a more general .m file?


Thank you so much again for the quick replies and the help!

Re: Optimal Monetary Policy with nonlinear loss function

PostPosted: Mon Jan 23, 2017 11:01 am
by jpfeifer
For looping over parameters, see http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=4891. In your case, you would not loop over resol or stoch_simul, but over
Code: Select all
perfect_foresight_solver

Re: Optimal Monetary Policy with nonlinear loss function

PostPosted: Mon Jan 23, 2017 9:36 pm
by Beav
Thank you so much!

Is there any way in which I can loop over values of the shock too?

Thanks again!

Re: Optimal Monetary Policy with nonlinear loss function

PostPosted: Wed Jan 25, 2017 7:41 am
by jpfeifer
Just set the respective entry in
Code: Select all
oo_.exo_simul

in the loop and then call
Code: Select all
perfect_foresight_solver