Discretionary policy

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Discretionary policy

Postby marlenemaya » Mon Jun 05, 2017 9:16 pm

Hi!
I'm running a new keynesian stochastic model.I'm evaluating the welfare loss with a ramsey_policy rule. Then I switched to discretionary_policy, but I meet some errors messages. In particular
Code: Select all
Error using discretionary_policy_1 (line 71)
discretionary_policy: the objective function must have zero first order derivatives

Error in stoch_simul (line 76)
    [oo_.dr,ys,info] = discretionary_policy_1(oo_,options_.instruments);

Error in discretionary_policy (line 25)
info = stoch_simul(var_list);

Error in ed (line 231)
discretionary_policy(var_list_);

Error in dynare (line 223)
evalin('base',fname) ;
 

I attach here my code. What should I change?
Thank you in advance
Attachments
edsingle.m
my code
(8.61 KiB) Downloaded 79 times
marlenemaya
 
Posts: 19
Joined: Mon Nov 21, 2016 3:56 pm

Re: Discretionary policy

Postby jpfeifer » Tue Jun 06, 2017 7:00 am

You need to provide the mod-file, not the m-file. My guess is that your objective function is not written in terms of centered second moments, but rather contains a linear term as well (e.g. if there is a distorted steady state)
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Discretionary policy

Postby marlenemaya » Tue Jun 06, 2017 10:23 am

Sorry this is the correct file.
Attachments
ed.mod
(2.93 KiB) Downloaded 94 times
marlenemaya
 
Posts: 19
Joined: Mon Nov 21, 2016 3:56 pm

Re: Discretionary policy

Postby jpfeifer » Wed Jun 07, 2017 6:24 am

Your objective contains
Code: Select all
((1-n)/kappa_f)*pp_f

at the end. This is a linear term, not a quadratic one.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Discretionary policy

Postby marlenemaya » Sun Jun 11, 2017 9:40 pm

Thank you!
That was a mistake!
The problem, anyway,remains. When I try to run the code I receive an error message saying that the objective function should have zero first order derivative. I don't really know how to get out of it....
Thank you
marlenemaya
 
Posts: 19
Joined: Mon Nov 21, 2016 3:56 pm

Re: Discretionary policy

Postby jpfeifer » Mon Jun 12, 2017 6:05 pm

Please provide the updated mod-file
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Discretionary policy

Postby marlenemaya » Mon Jun 12, 2017 6:42 pm

This is the updated file-
Thank you
Attachments
ed.mod
(2.92 KiB) Downloaded 98 times
marlenemaya
 
Posts: 19
Joined: Mon Nov 21, 2016 3:56 pm

Re: Discretionary policy

Postby jpfeifer » Mon Jun 12, 2017 6:50 pm

Code: Select all
(n*sigmas)/2)*(s-sb)

is still linear
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Discretionary policy

Postby marlenemaya » Mon Jun 12, 2017 7:52 pm

Yes ist's true. Anyway also correcting the code (every element at ^2), I receive te following error message:
Error using print_info (line 133)
Discretionary policy: NaN elements are present in the solution. Procedure failed.

Error in stoch_simul (line 94)
print_info(info, options_.noprint, options_);

Error in discretionary_policy (line 25)
info = stoch_simul(var_list);

Error in ed (line 236)
discretionary_policy(var_list_);

Error in dynare (line 223)
evalin('base',fname) ;
marlenemaya
 
Posts: 19
Joined: Mon Nov 21, 2016 3:56 pm

Re: Discretionary policy

Postby jpfeifer » Wed Jun 14, 2017 4:30 pm

There must still be a fundamental timing error in the model. model_diagnostics says:
Code: Select all
MODEL_DIAGNOSTICS: The following endogenous variables aren't present at the current period in the model:
w   
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Discretionary policy

Postby marlenemaya » Thu Jun 15, 2017 3:26 pm

The problem is that if I specify the expression for the losses in the model(that is linear), it cannot be solved because is not linear.
I don't really know what to do....
marlenemaya
 
Posts: 19
Joined: Mon Nov 21, 2016 3:56 pm

Re: Discretionary policy

Postby jpfeifer » Fri Jun 16, 2017 8:57 am

Those are two different things. The objective function does not belong in the model-block. But when a variable does not appear with contemporaneous timing, it indicates a timing error in the model. That variable would otherwise not be determined by your model
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Discretionary policy

Postby marlenemaya » Fri Jun 16, 2017 2:34 pm

thank, you...maybe I've found what's wrong.....the welfare losses w(the objective function), are the infinite summation of the welfare losses from 0 to infinitive. I should find a way to include this summation into the expression, but I've read that on dynare is not possible. I should transform the sum in a recursive expression (since I cannot linearize the objective function) but I don't know exactly how to do it...
Thank you for the big help until now!
marlenemaya
 
Posts: 19
Joined: Mon Nov 21, 2016 3:56 pm

Re: Discretionary policy

Postby marlenemaya » Fri Jun 16, 2017 2:38 pm

Nb also I cannot enter lagged or lead variables into the discretionary_policy command...
marlenemaya
 
Posts: 19
Joined: Mon Nov 21, 2016 3:56 pm

Re: Discretionary policy

Postby jpfeifer » Sat Jun 17, 2017 3:17 pm

The planner_objective takes a period utility function, not the intertemporal one. If you need leads or lags in the objective, you need to define an auxiliary variable defining the lag in the model block and then use that auxiliary variable
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 12 guests