Page 1 of 2

Difference between different types of moments

PostPosted: Mon Nov 24, 2014 4:53 am
by Grant
Dear Jpfeifer,

I am confused about the difference between theoretical moments and empirical moments. I use dynare to solve a log-linearized model. I know that if I set "period" command equals zero, theoretical moments will be computed. My understanding is that theoretical moments is the moments generated from the posterior distribution, while empirical moment is simulated moment, which is generated from the posterior mean and start to simulate at the steady state. Am I right?
BTW, I also need to compare the moments generated from the model and that of the actual data. Which type of moments should I use?

I am looking forward to your help. Thanks in advance.

Re: Difference between different types of moments

PostPosted: Tue Nov 25, 2014 7:13 am
by jpfeifer
No. Generally, theoretical moments are the one computed based on the state space representation of the solved model. See e.g. Hamilton (1994): Time Series Econometrics. These moments are computed at the parameter vector given, i.e. either the calibrated ones when running stoch_simul directly or the one from estimation if running stoch_simul after estimation.

Simulated moments are based on simulation from the model solution for a specified period of time. If you run sufficiently many periods, the simulated moments will converge to the theoretical moments (asymptotically).

There is no general rule what is better to compare. Several short simulations of the same length as your actual data or the theoretical moments. I would personally go for the latter.

Re: Difference between different types of moments

PostPosted: Mon Dec 01, 2014 6:48 am
by quiko
Hi,

A related question. When solving a log-linearized model, I run a loop over some parameter and then I look at the variance generated for those different parameters.

I extract the second moments by doing:
var = diag(oo_.var);

Then I plot var as a function of the parameters over which I have looped. So here my (silly) question is: what is the unity of measure of this volatility? Should I worry if I observe big numbers like 21,400 on the y-scale?

Re: Difference between different types of moments

PostPosted: Wed Dec 03, 2014 11:26 am
by jpfeifer
It depends on the definition of your variables.

If they are in levels, the variance is measured in the units of the levels sqared. For example, think of real GDP as apples then the variance will have units of apples squared. The standard deviation will have the units of apples. You can see that the variance will be massively affected if you change the underlying units. If you measure GDP in quarter apples instead of apples, the variance will increase by Var(4*x)=16*Var(x) by a factor of 16. Hence, depending on the unit of measurement, the number can be really big.

If you logged the variables/they are in percentage deviations, i.e. unit free. The units will be percent squared for the variance and percent for the standard deviations. Here, a large variance in the four figures you report is problematic.

Re: Difference between different types of moments

PostPosted: Fri Dec 05, 2014 5:02 am
by quiko
Thanks for the reply.

The model is log-linearized around the steady-state, so if I got it right my variance is percentage deviation from the steady state. I'm not actually interested to the magnitude of the variance, so in principle having big numbers does not bore me, I am interested to the dynamics.

But I wonder wether by "problematic" you mean that it is a mistake and I should fix this or not.

Re: Difference between different types of moments

PostPosted: Fri Dec 05, 2014 2:47 pm
by jpfeifer
How did you scale your shock terms? Is 1 a standard deviation of 1 percent or 100 percent? If it is the latter, there must be something wrong.

Re: Difference between different types of moments

PostPosted: Mon Dec 08, 2014 3:40 pm
by quiko
I have put:

shocks;
var e; stderr 1

I don't know if that's what you mean. Should it be 0.01?

Re: Difference between different types of moments

PostPosted: Tue Dec 09, 2014 6:29 am
by jpfeifer
That's what I meant. Compared to using
shocks;
var e; stderr 0.01;
end;

every variance will be scaled by 100^2 which might explain your big numbers-

Re: Difference between different types of moments

PostPosted: Thu Dec 11, 2014 11:41 am
by quiko
Thank you I see it now.

I have another small question, but it's not related. Please let me know if I should post it in another section.

The question is:

If I want to introduce two shocks (a technology shock and a monetary shock), assuming both shocks have the same functional form:
a = rho*a(-1) + e;

Is it correct to add "a" (I assume a log-linearized model) to the production function and the Taylor rule? Or I should use two different notations for both shocks, even if they have identical functional form?

Re: Difference between different types of moments

PostPosted: Thu Dec 11, 2014 11:59 am
by jpfeifer
You need to add two shocks. Otherwise, the two shocks will be identical, i.e. monetary and technology shocks would be perfectly correlated.

Re: Difference between different types of moments

PostPosted: Thu Dec 11, 2014 6:46 pm
by devidosti
Dear professor Pfeifer,

I wish you could help to fix the Dynare code to perform a replication of the paper by Nakamura and Steinsson "Fiscal Stimulus in a Monetary Union: Evidence from a Monetary Union", AER, '14. In particular, I am having troubles with the section F of their online appendix (https://www.aeaweb.org/aer/app/10403/20111109_app.pdf), where they introduce capital in their New-Keynesian model. Here capital is assumed to be owned by households, who lend it to firms which use it for investment. So there is a capital rental rate, investment, capital, a part of if which is lent etc. My problem is related with the Jacobian of the steady states..could you please help me in adjusting the file?

Thanks a lot and best regards,

Davide

Re: Difference between different types of moments

PostPosted: Thu Dec 11, 2014 7:21 pm
by jpfeifer
Focus on:
Code: Select all
Warning: Some of the parameters have no value (A_c, a_c, a_pi, zeta, sigma_c, zeta_c, zeta_g) when using steady. If these parameters are not initialized in a
steadystate file, Dynare may not be able to solve the model..

Please set these parameters.

Re: Difference between different types of moments

PostPosted: Fri Dec 12, 2014 8:31 am
by devidosti
I am sorry, but these parameters have all been set, except with sigma_c, which now I fixed. But still it doesn't work!

couldn't there be some deeper problems due to the fact that I did not select the right identifying equations?

Best,

Davide
Doctoral student
at ECARES -- ULB

Re: Difference between different types of moments

PostPosted: Fri Dec 12, 2014 12:42 pm
by jpfeifer
Your parameter initializations are not recursive. Try using F9 to execute the initializations before the model-block to see that zeta uses psi_nu in its definition, but psi_nu is only defined later on.

Re: Difference between different types of moments

PostPosted: Fri Dec 12, 2014 2:40 pm
by devidosti
what exactly do you mean by executing the first block with F9?