Page 1 of 1

Parameter estimation

PostPosted: Sat May 24, 2014 10:42 am
by rox17
Hy,

I experience some errors in my estimation (attached the code and data if anyone would like to take a look) :

78.3% of the prior support gives unique saddle-path solution.
0.0% of the prior support gives explosive dynamics.
21.6% of the prior support gives indeterminacy.
Smirnov statistics in driving acceptable behaviour
psi_pi d-stat = 0.524 p-value = 0.000
psi_pis d-stat = 0.524 p-value = 0.000

Smirnov statistics in driving indeterminacy
psi_pi d-stat = 0.410 p-value = 0.000
psi_pis d-stat = 0.410 p-value = 0.000


Starting bivariate analysis:

Correlation analysis for prior_stable
[tetas,psi_y]: corrcoef = -0.097

Correlation analysis for prior_unacceptable
[teta_f,rho_gs]: corrcoef = 0.188
[fi,rhos]: corrcoef = 0.153
[h,rho_cp]: corrcoef = 0.167
[psi_pi,psi_pis]: corrcoef = -0.591
[tetas,psi_y]: corrcoef = 0.357

Correlation analysis for prior_indeterm
[teta_f,rho_gs]: corrcoef = 0.188
[fi,rhos]: corrcoef = 0.153
[h,rho_cp]: corrcoef = 0.167
[psi_pi,psi_pis]: corrcoef = -0.591
[tetas,psi_y]: corrcoef = 0.357
Computing theoretical moments ...
Undefined function 'Sigma_e_' for input arguments of type 'double'.

Re: Parameter estimation

PostPosted: Sat May 24, 2014 1:10 pm
by rox17
Can anyone give an answer ?
Thanks.

Re: Parameter estimation

PostPosted: Sat May 24, 2014 4:40 pm
by rox17
I managed to obtain

All parameter values in the specified ranges give unique saddle-path solution!

but there's something wrong although,

Computing theoretical moments ...
Undefined function 'Sigma_e_' for input arguments of type 'double'.

Error in set_shocks_param (line 42)
Sigma_e(k1,k2) = xparam1(i+offset)*sqrt(Sigma_e_(k1,k1)*Sigma_e_(k2,k2));

Error in mc_moments (line 34)
set_shocks_param(ss(j,:));

Error in map_ident_ (line 58)
[vdec, cc, ac] = mc_moments(T, lpmatx, oo_.dr);

Error in dynare_sensitivity (line 239)
map_ident_(OutputDirectoryName,options_gsa);

Error in cod_original (line 323)
dynare_sensitivity(options_gsa);

Error in dynare (line 180)
evalin('base',fname) ;

When i use "identification" command :

Testing ML Starting value
Error using .*
Matrix dimensions must agree.

f1 f1 :)

Re: Parameter estimation

PostPosted: Mon May 26, 2014 1:03 pm
by jpfeifer
That is a bug. We will look into it and keep you posted.

Re: Parameter estimation

PostPosted: Tue May 27, 2014 12:00 pm
by rox17
how can i test gelman brooks convergence ?

Re: Parameter estimation

PostPosted: Tue May 27, 2014 12:52 pm
by jpfeifer
By running two MCMC chains with at least 2000 observations, i.e.
Code: Select all
estimation(...,mh_nblocks=2,mh_replic=10000)

Re: Parameter estimation

PostPosted: Tue May 27, 2014 3:42 pm
by rox17
initial value of the log posterior : -121.3284

POSTERIOR KERNEL OPTIMIZATION PROBLEM!
(minus) the hessian matrix at the "mode" is not positive definite!
=> posterior variance of the estimated parameters are not positive.
You should try to change the initial values of the parameters using
the estimated_params_init block, or use another optimization routine.
Warning: The results below are most likely wrong!

Re: Parameter estimation

PostPosted: Wed May 28, 2014 7:46 am
by jpfeifer
Search the forum for that one. At least 5 percent of the posts used to deal with this.

Re: Parameter estimation

PostPosted: Thu May 29, 2014 3:55 am
by rox17
After estimation, 4 of my shocks have 0 std err and t statistic. only one has 0.9879 1.0512 . most constants provide the same pair of values for (std err, t stat) :0 .
also, the smooth shocks graph looks like a white noise for 2 of them .
this is definitely a bad estimation, but i don t understand what is the cause: constants or missmatch between the data/variab ?

Re: Parameter estimation

PostPosted: Thu May 29, 2014 1:25 pm
by jpfeifer
Please post the most recent version.

Re: Parameter estimation

PostPosted: Sun Jun 01, 2014 8:26 pm
by rox17
attached.

Re: Parameter estimation

PostPosted: Mon Jun 02, 2014 5:06 am
by jpfeifer
The data file is also required.

Re: Parameter estimation

PostPosted: Mon Jun 02, 2014 5:08 pm
by rox17
Attached an archive with code & data file.

If the mle analysis is performed, although dynare notifies me that the estimation is most likely wrong due to the negative hessian, why aren't confidence intervals computed ?
what else can i use to test the strength of the model ?
i'm also not sure what algorhytm to select in the "estimation"function if i don't perform bayesian estim. so far i have used only 4 and 6.

y corresponds to the o.g. (log deviation of the trend from gdp)
i - interest rate ( diff(1) to obtain a stationary distrib)
pi - inflation rate, obtained as log diff of price index
s - real exchange rate (log diff for the same reason - stationarity) .

i tried to estimate parameters without the shocks block in order to identify the param that have issues.
the identification strength & the sensivity component with moments inf matrix plots show only blue columns (relative to param value) ; relative to prior std which should have been plotted with red are smaller than the blue ones and they don t overlap or... ?

thank you very much professor.

Re: Parameter estimation

PostPosted: Fri Jun 06, 2014 5:32 pm
by jpfeifer
A lot of things:
1. All parameters are identified. That is not the source of your problems. The observation equations are. See below. That something is severely wrong can be seen in the fact that many parameters like psi_y or nui are at their upper bounds at the mode. That always results in a non-positive definite Hessian as you did not find an interior maximum.
2. Without Bayesian estimation and a specified prior, identification cannot display identification strenght relative to the prior mean.
3. Confidence intervals for what? You get mean and standard deviation for the parameter. CI for the parameters directly follow. For IRFs, you need to add the bayesian_irf-option
4. Finding the mode to your model is hard. Use mode_compute=6,9 or 10.
5. Your observation equations are wrong. The way you do it currently, e.g. pi has mean 0 in the model, but is not demeaned in the data. Similarly, the interest rate in the model is not in first differences, but your data is. You cannot say they are equal. You need to fix that. 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 details.