Page 1 of 1

HELP!Why I get so many zeros in variance decomposition

PostPosted: Wed Apr 01, 2015 11:46 am
by wxhmatchpoint
Hi Dynare Experts,

I wrote a code about an open economy with financial shock. I ask four variables to be simulated.
But when I see my result of variance decomposition,I find there are only two variables listed.
Besides, as I have six shocks in the model, four shocks contributes ZERO to the two variables.
So could anyone tell me what might be the reasons?
Thank you in advance.

Jason

Re: HELP!Why I get so many zeros in variance decomposition

PostPosted: Thu Apr 02, 2015 9:16 am
by jpfeifer
Sounds like a problem with the model. Please provide the files to replicate the issue.

Re: HELP!Why I get so many zeros in variance decomposition

PostPosted: Fri Apr 03, 2015 12:07 pm
by wxhmatchpoint
fffsolrevise1.mod
a small open economy with financial friction and financial shock
(8.97 KiB) Downloaded 54 times
jpfeifer wrote:Sounds like a problem with the model. Please provide the files to replicate the issue.

Thank you for your reply.My file is attached in the following.

PS: I tired to change the standard deviation and the result was slightly improved. I am not sure if this is the reason.

Re: HELP!Why I get so many zeros in variance decomposition

PostPosted: Fri Apr 03, 2015 12:14 pm
by jpfeifer
Look at the covariance matrix in M_.Sigma_e
M_.Sigma_e
ans =
30.0304 0 0 0 0 0
0 17.8929 0 0 0 0
0 0 0.0021 0 0 0
0 0 0 0.0000 0 0
0 0 0 0 0.0032 0
0 0 0 0 0 0.0002


The first two shocks are two orders of magnitude larger and thus drive everything.

Re: HELP!Why I get so many zeros in variance decomposition

PostPosted: Fri Apr 03, 2015 1:04 pm
by wxhmatchpoint
jpfeifer wrote:Look at the covariance matrix in M_.Sigma_e
M_.Sigma_e
ans =
30.0304 0 0 0 0 0
0 17.8929 0 0 0 0
0 0 0.0021 0 0 0
0 0 0 0.0000 0 0
0 0 0 0 0.0032 0
0 0 0 0 0 0.0002


The first two shocks are two orders of magnitude larger and thus drive everything.

Well, thank you very much for your immediate reply.
But as I am new to dynare, could you tell me where to find this file?

Re: HELP!Why I get so many zeros in variance decomposition

PostPosted: Fri Apr 03, 2015 1:13 pm
by jpfeifer
It is not a file. It is just restating that comparing
Code: Select all
sigg = 0.046;

to
Code: Select all
siga = 5.48;          // two above from zhang's BE

Implies two order of magnitude difference in your shock calibration.

Re: HELP!Why I get so many zeros in variance decomposition

PostPosted: Fri Apr 03, 2015 1:39 pm
by wxhmatchpoint
jpfeifer wrote:It is not a file. It is just restating that comparing
Code: Select all
sigg = 0.046;

to
Code: Select all
siga = 5.48;          // two above from zhang's BE

Implies two order of magnitude difference in your shock calibration.


Thank you for your answer.
I also notice that some variables can not be simulated as follows

THEORETICAL MOMENTS

VARIABLE MEAN STD. DEV. VARIANCE
y 0.0000 0.0406 0.0016
c NaN NaN NaN
i NaN NaN NaN
r 0.0000 0.0012 0.0000
pi 0.0000 0.0036 0.0000

So could you tell me what may be the reasons? If I add some shocks, would it work?

Re: HELP!Why I get so many zeros in variance decomposition

PostPosted: Mon Apr 06, 2015 8:25 pm
by jpfeifer
Because your model features a unit root so that the second moment of these variables does not exist. Try running model_diagnostics on your model.

Re: HELP!Why I get so many zeros in variance decomposition

PostPosted: Tue Apr 07, 2015 11:42 am
by wxhmatchpoint
jpfeifer wrote:Because your model features a unit root so that the second moment of these variables does not exist. Try running model_diagnostics on your model.

Thank you for your answer.
It seems that there is a equation
pi = p - p(-1)
which could lead to the unit root. But this equation is necessary in the model.
So do you know how to eliminate the problem?

Re: HELP!Why I get so many zeros in variance decomposition

PostPosted: Tue Apr 07, 2015 6:49 pm
by jpfeifer
The equation you describe is not necessary, but rather a simple definition of inflation. Generally, you can write all variables as real variables by dividing with the price level. If the variables you mentioned with moments equal to NaN are nominal variables, then you have found the source of your problem: the nominal variables are not stationary, because the price level has a unit root. Only their real counterparts and inflation are stationary. See Pfeifer(2013): "A Guide to Specifying Observation Equations for the Estimation of DSGE Models" https://sites.google.com/site/pfeiferecon/Pfeifer_2013_Observation_Equations.pdf for an example.