Optimal policy and welfare losses

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.

Optimal policy and welfare losses

Postby Tunit » Wed Dec 07, 2011 11:25 am

Hi,
Does anyone know how to write a loop to obtain a number welfare losses for alternative parameter values using the ramsey_policy function.
For example,

rhos=[0.5,0.6,0.8,0.9];
for i =1:length(rhos)
rho=rhos(i);
Stoch_simul;
end

works for a usual file with just simulations yet I get the following error message when trying to obtain the ramsey losses.

??? Index exceeds matrix dimensions.

Error in ==> stoch_simul at 142
var_listTeX = M_.endo_names_tex(i_var,:);
Thanks
Tunit
Tunit
 
Posts: 4
Joined: Wed Dec 07, 2011 11:15 am

Re: Optimal policy and welfare losses

Postby SébastienVillemot » Wed Jan 04, 2012 11:19 am

Can you post your complete MOD file?
Sébastien Villemot
Economist at OFCE – Sciences Po
SébastienVillemot
 
Posts: 706
Joined: Fri Dec 07, 2007 2:29 pm
Location: Paris, France

Re: Optimal policy and welfare losses

Postby Tunit » Fri Jan 06, 2012 11:02 am

HI thanks for the reply. Below is the file. essentially what I would like to do is simulate (and save) the welfare losses for a range of one exogenous variable eg rho=[0, 0.1, 0.1...1]/
this is possible for a range of simulated output (using the method outilined in my original post). However, I do not seem to be able to any same result using the ramsey_policy function.
Best,
Tunit
~~~~~~~~~~~~~~~~~~~~
///Simulations

//Endogenous Variables
var
xtilde,
xeuler,
gshock,
pi,
yflex,
ytilde,
int,
a,
xi,
v;



//Exogenous variables
Varexo
epsilona,
epsilonxi,
epsilonv;

//Parameters
parameters
theta,
thetafixed
omega,
beta,
kappa,
sigma,
gamma,
eta,
phipi,
phix,
rhoa,
rhoxi,
rhov,
rhoint,
stdra,
stdrxi,
stdrv,
delta,
vartheta,
lambdapi,
lambdaxi;


beta=0.99; //Discount rate
sigma=1.5;
thetafixed=1.5; //Intertemporal elasticity of substitution in consumption
theta=0; //The price elasticity of demand
omega=0.75; //percentage of firms unable to alter thier price in each period
gamma=1; //Intertemporal elasticity of substituiton in the labour market.
rhoa=0.85; //Persistence of productivity shocks
rhoxi=0.85; //Persistence of taste shocks
rhov=0.5; //Persistence of policy shocks
rhoint=0.85; //persistence of the interest rate
phipi=1.5; //weight on interest rate in objective function
phix=0.5/4; //weight on output gap in objectibe function
eta=0; //percentage of backward looking firms //persistence of interest rate shocks
stdra=0; //variance of technology shocks
stdrxi=0; //variance of taste shocksw
stdrv=0.25; //variance of interest rate shocks
delta=1; //when 1 we have cost channel when zero no channel
vartheta=omega+(eta*(1-omega*(1-beta))); //backward looking element
kappa=(1-omega*beta)*(1-omega)/omega; //slope of the Phillips Curve
lambdapi=(thetafixed/kappa);
lambdaxi=(sigma+gamma);




model;

xtilde=xeuler-((theta/kappa)*pi)+((theta/kappa)*beta*pi(1));//Outputgap

xeuler=xeuler(1)-(1/sigma)*(int-pi(1))+gshock; //Euler equation

gshock=((1+gamma)/(gamma+sigma))*(a(1)-a)-(gamma/(sigma*(gamma+sigma)))*(xi(1)-xi); //disturbance term

pi=((1-omega)*(1-omega*beta)/(omega+(eta*(1-omega))))*(((1-eta)*(((sigma+gamma)*xtilde)+(delta*int)))+(eta*(((sigma+gamma)*xtilde)+(delta*int))))+((((1-omega)*eta)/(omega+(eta*(1-omega))))*pi(-1))+(((omega*beta)/(omega+(eta*(1-omega))))*pi(1));
//Phillips Curve

yflex=(((1+gamma)/(gamma+sigma)))*a+(1/(gamma+sigma))*xi; //flexible Output

ytilde=xtilde+yflex; //Output or Consumption

int=rhoint*int(-1)+(1-rhoint)*((phipi*pi)+(phix*xtilde))+v; ///interest rate

a=rhoa*a(-1)+epsilona; //Ar(1) technology
xi=rhoxi*xi(-1)+epsilonxi; //Ar(1) taste
v=rhov*v(-1)+epsilonv; //Ar(1) int


end;
check;
steady;

shocks;
var epsilona;
stderr stdra;
var epsilonxi;
stderr stdrxi;
var epsilonv;
stderr stdrv;
end;

planner_objective lambdapi*pi^2 + lambdaxi*xi^2;

ramsey_policy;

loss=.5*(lambdapi*oo_.var(4,4)+lambdaxi*oo_.var(1,1));
lossinf=0.5*(lambdapi*oo_.var(4,4));
lossout=0.5*(lambdaxi*oo_.var(1,1));
Tunit
 
Posts: 4
Joined: Wed Dec 07, 2011 11:15 am

Re: Optimal policy and welfare losses

Postby SébastienVillemot » Mon Jan 16, 2012 5:15 pm

I'm afraid that this exercise will be difficult with the current version of Dynare (4.2) for two reasons:

- ramsey_policy seems to not work within a loop
- ramsey_policy does not give the value of the welfare

You may want to try with the unstable snapshot of Dynare (the usual disclaimer applies here), since the ramsey policy engine was rewritten there. But there seem to be also issues to resolve in your model: Dynare unstable complains about the fact that initial values are incompatible with some equations (I did not investigate this issue).
Sébastien Villemot
Economist at OFCE – Sciences Po
SébastienVillemot
 
Posts: 706
Joined: Fri Dec 07, 2007 2:29 pm
Location: Paris, France

Re: Optimal policy and welfare losses

Postby YHS » Tue May 15, 2012 6:39 pm

You have to remove "check;" and "steady;" when using Ramsey policy.
YHS
 
Posts: 8
Joined: Fri May 11, 2012 11:41 pm

Re: Optimal policy and welfare losses

Postby mnb_kobercs » Wed Aug 01, 2012 9:08 am

Hi all!

Is it possible, to control somehow on impulse response functions, when computing optimal ramsey or osr in dynare?
for example: I (and the mpc) won't belive in an "optimal" policy that suggest rate cuts for a demand shock
many thanks!
mnb_kobercs
 
Posts: 3
Joined: Wed Aug 01, 2012 9:02 am

Re: Optimal policy and welfare losses

Postby mnb_kobercs » Wed Aug 01, 2012 2:57 pm

Hi!
Another question.
How can I add bounds, for the osr parameters? I got an optimal solution where the interest rate smoothing higher than 1... :cry:
please help me!!!
mnb_kobercs
 
Posts: 3
Joined: Wed Aug 01, 2012 9:02 am

Re: Optimal policy and welfare losses

Postby Kuralay » Tue Dec 10, 2013 9:45 am

Hi, who could explain me what do numbers (4,4) and (1,1) mean in this welfare loss equation?

loss=.5*(lambdapi*oo_.var(4,4)+lambdaxi*oo_.var(1,1));

Thanks in advance.
Kuralay
 
Posts: 2
Joined: Tue Dec 10, 2013 9:34 am

Re: Optimal policy and welfare losses

Postby jpfeifer » Tue Dec 10, 2013 10:00 am

Those are entries of the variance covariance matrix. They are the variance of the first and fourth variable, respectively.
------------
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 5 guests