Page 1 of 1

negative shock in stochastic simulation

PostPosted: Sun Feb 19, 2012 1:55 am
by LittleFish
Does anybody know how to impose a negative shock, say a decrease in government spending, in a stochastic simulation? Thanks!

I tried: var g = -0.1. But there seems to be some problem with the cholesky decomposition.

??? Error using ==> chol
Matrix must be positive definite.

Error in ==> th_autocovariances at 142
cs = chol(SS)';

Error in ==> disp_th_moments at 37
[oo_.gamma_y,stationary_vars] = th_autocovariances(dr,ivar,M_,options_);

Error in ==> stoch_simul at 134
disp_th_moments(oo_.dr,var_list);

Error in ==> model4a at 323
info = stoch_simul(var_list_);

Error in ==> dynare at 120
evalin('base',fname) ;

Re: negative shock in stochastic simulation

PostPosted: Sun Feb 19, 2012 9:56 am
by jpfeifer
Leave everything as in the positive shock case, but instead of adding a positive shock, subtract a positive one. In the model block, if you had something like:
Code: Select all
G=rho*G+eps_g;

it should read
Code: Select all
G=rho*G-eps_g;