Page 1 of 1

two warnings during dynare stoch_simul

PostPosted: Mon Aug 15, 2016 8:01 am
by xuz
Hi all,

My .mod file ends with

Code: Select all
stoch_simul(order=2, pruning,irf=30, nograph);


The code goes through well except two earnings. The printout screen looks like:

MODEL SUMMARY
nothing special here

MATRIX OF COVARIANCE OF EXOGENOUS SHOCKS
nothing special here

POLICY AND TRANSITION FUNCTIONS
nothing special here

Warning: Matrix is close to singular or badly scaled. Results may be
inaccurate. RCOND = 1.451571e-18.
> In th_autocovariances at 149
In disp_th_moments at 37
In stoch_simul at 164
In modfilename at 687
In dynare at 180
Warning: Aggregate variance and sum of variances by shocks differ by more than
0.01 %
> In th_autocovariances at 198
In disp_th_moments at 37
In stoch_simul at 164
In modfilename at 687
In dynare at 180


APROXIMATED THEORETICAL MOMENTS

some "NAN"s

APPROXIMATED VARIANCE DECOMPOSITION (in percent)
nothing special here
APPROXIMATED MATRIX OF CORRELATIONS
nothing special here
APPROXIMATED COEFFICIENTS OF AUTOCORRELATION
nothing special here

In the model, one variable follows random walk, and some variables are functions of this random walk.

1. I guess that APROXIMATED THEORETICAL MOMENTS have NAN because of the random walk.
2. I'm not sure how the first warning affects the model's performance. Is it a red flag? Is it due to random walk variable?
3. As for the second warning, I find the post viewtopic.php?f=1&t=4409 very useful. It says that this warning may come from the large size of my model, and it's not avoidable. I wonder whether the random walk behavior of endogenous variable will contribute to this warning.

Thanks very much for your help!

Re: two warnings during dynare stoch_simul

PostPosted: Mon Aug 15, 2016 11:56 am
by jpfeifer
Yes, the unit root will cause the NaN in the theoretical moments. If your model is large, numerical problems can arise and there is not much you can do. Unless there is anything else suspicious, these warnings can be ignored.

Re: two warnings during dynare stoch_simul

PostPosted: Wed Aug 17, 2016 6:20 am
by xuz
jpfeifer wrote:Yes, the unit root will cause the NaN in the theoretical moments. If your model is large, numerical problems can arise and there is not much you can do. Unless there is anything else suspicious, these warnings can be ignored.


Thanks!

One more question,
When I change the last line of the mod file from
stoch_simul(order=1, irf=500);
to
stoch_simul(order=2, pruning, irf=500);

The change of IRF is small.

When I change the last line of the mod file from
stoch_simul(order=1, irf=500);
to
stoch_simul(order=3, pruning, irf=500);

The change of IRF is huge:
e.g. the initial response of variable x to shock y is -10^(-5) with order =1, becomes -2*10^(-4) with order 2 and becomes -100 with order =3.

I take this as a bad sign of my model. I think this is a result of the curvature of my equations. I wonder whether in general the unit root will contribute to the large IRF size when taking the third order. Thank you very much!

Re: two warnings during dynare stoch_simul

PostPosted: Wed Aug 17, 2016 6:36 am
by jpfeifer
That is strange and should normally not happen. Could you please send me the file.

Re: two warnings during dynare stoch_simul

PostPosted: Fri Aug 19, 2016 8:48 am
by jpfeifer
The reason is that despite using pruning, your simulations seem quite explosive. Values in the order of 1E9 appear. This might be due to the unit root, where big shocks accumulate. At first order, that might not be a large issue, but at higher order it is.

Re: two warnings during dynare stoch_simul

PostPosted: Tue Aug 23, 2016 10:31 pm
by xuz
jpfeifer wrote:The reason is that despite using pruning, your simulations seem quite explosive. Values in the order of 1E9 appear. This might be due to the unit root, where big shocks accumulate. At first order, that might not be a large issue, but at higher order it is.

Thanks!