simulated moments

When the moments are calculated from simulations, they are calculated from a single simulation (of size=periods), correct? Is there quick way to take the average of multiple simulations to get the moments? Thanks.
Forums for asking questions, posting comments and uploading examples related to Dynare
http://www.dynare.org/phpBB3/
otb wrote:Let me ask some related questions, and maybe I can get answers to my previous questions as well.
Should the moments generated from a single simulation approach the true theoretical moments as we increase periods?
otb wrote:If so, why do some papers generate moments from multiple simulations each of which have a small number of periods (typically equal to the number of periods in the data)?
y_t = c + \rho y_{t-1} + \epsilon_t
E_{\infty}[y_t] = \frac{c}{1-\rho}
V_{\infty}[y_t] = \frac{\sigma^2}{1-\rho^2}
E[y_1] = c + \rho E[y_0] = (1 + \rho) \times c
V[y_1] = \rho^2 V[y_0] + \sigma^2 = (1+\rho^2) \times \sigma^2
E[y_2] = c + \rho E[y_1] = (1 + \rho + \rho^2) \times c
V[y_2] = \rho^2 V[y_1] + \sigma^2 = (1+\rho^2+\rho^4) \times \sigma^2
E[y_t] = (1 + \rho + ... +\rho^t) \times c
V[y_t] = (1+\rho^2+ ... + \rho^{2t}) \times \sigma^2
E[y_t] = \frac{1-\rho^{t-1}}{1-\rho} \times c
V[y_t] = \frac{1-\rho^{2(t-1)}}{1-\rho^2} \times \sigma^2
otb wrote:Thanks for the detailed response Stephane. This was very helpful. Since I want asymptotic moments, I should be fine.
But in any case, does Dynare conduct multiple simulations?
if info;
disp(['Computation fails for gamma_y = ' num2str(gamma_y)]);
else
moments{s,1}=oo_;
end;
if info;
disp(['Computation fails for gamma_y = ' num2str(gamma_y)]);
else
moments(:,s)=diag(oo_.var);
end;
jpfeifer wrote:It depends what exactly you need. Variances are stored in oo_.variance, so
- Code: Select all
if info;
disp(['Computation fails for gamma_y = ' num2str(gamma_y)]);
else
moments(:,s)=diag(oo_.var);
end;
covars=triu(oo_.var);