Page 1 of 1

2nd order approximation yields negative consumption

PostPosted: Tue Apr 18, 2017 8:14 am
by zolnier
Hello

I am trying to loop over parameter values for a simple Taylor rule and then perform a stochastic simulation using stoch_simul so that I can extract the mean values for consumption (which will be used in a comparison with a Ramsey policy outcome later on). I run a 2nd order approximation and I get that the mean of consumption is a negative number when the parameter value for inflation takes on a value close to 1.

The loop (that I found on this forum) looks like:
Code: Select all
phi_ys= 0:0.1:5;
phi_pis = 0:0.1:5;

first_time = 1;

res_alt=cell(length(phi_ys), length(phi_pis));
param_values_alt=cell(length(phi_ys), length(phi_pis));
mean_values_alt=cell(length(phi_ys), length(phi_pis));

for i=1:length(phi_ys)
    for j=1:length(phi_pis)
        if first_time
            set_param_value('phi_y',phi_ys(i));
            set_param_value('phi_pi',phi_pis(j));
            dynare NK_hysterisis noclearall;
            first_time = 0;
        else
            set_param_value('phi_y',phi_ys(i));
            set_param_value('phi_pi',phi_pis(j));
            info = stoch_simul(var_list_);
            if info ==0;
                res_alt{i,j} = oo_;
                mean_values_alt{i,j} = res_alt{i,j}.mean(3); % Mean of consumption is the third value in the order.
                param_values_alt{i,j} = M_.params;
            else
                fprintf('model cannot be solved for phi_y=%3.2f and phi_pi=%3.2f\n ',phi_ys(i), phi_pis(j));
            end;
        end
    end
end


The loop works as expected with regards to changing the parameter values properly but the outcome is odd. In the .mod-file I have a "steady_state_model"-block which solves the model without any non-zero residuals so I believe that there is something wrong with the way I perform the stochastic simulations. As far as I've understood it, when the full Dynare routine is used in the first iteration the stoch_simul command in the loop will use the options provided in the stoch_simul included in the .mod-file. The options used are
Code: Select all
stoch_simul(noprint, nograph, irf=0, pruning, drop=200, replic=1000, order=2);


I am not sure whether it is something I am missing about the stochastic simulation or if there is something else going on.
Help would be much appreciated.

Re: 2nd order approximation yields negative consumption

PostPosted: Tue Apr 18, 2017 6:55 pm
by jpfeifer
Have a look at the decision rules provided for the second order approximation. They should give you the steady state and the mean correction. It might be that the mean cprrection is enormous. That potentially indicates that your shock variance is wrong (usually a factor of 100, i.e. saying a 1 percent standard deviation is stderr 1 instead of stderr 0.01)

Re: 2nd order approximation yields negative consumption

PostPosted: Wed Apr 19, 2017 9:35 am
by zolnier
It was indeed the size of the shocks that caused the problem - although not by a factor of 100. The shock size for a "cost push" shock was too large which caused the mean correction terms to blow up. Once the shock size was decreased the mean level of consumption returned to the range of plausible values again.

Thank you for your help Prof. Pfeifer.