by 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));