can you help me?

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

can you help me?

Postby yysun1986 » Sun Dec 22, 2013 3:56 am

sir, I am a student from japan. I get a problem with dynare, can you help me?
this is the error:
Configuring Dynare ...
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Local state space iteration (second order).
[mex] Bytecode evaluation.
[mex] k-order perturbation solver.
[mex] k-order solution simulation.
[mex] Quasi Monte-Carlo sequence (Sobol).
[mex] Markov Switching SBVAR.

Starting Dynare (version 4.3.3).
Starting preprocessing of the model file ...
Substitution of endo lags >= 2: added 2 auxiliary variables and equations.
Found 30 equation(s).
Evaluating expressions...done
Computing static model derivatives:
- order 1
Computing dynamic model derivatives:
- order 1
- order 2
Processing outputs ...done
Preprocessing completed.
Starting MATLAB/Octave computing.


You did not declare endogenous variables after the estimation/calib_smoother command.
Posterior IRFs, smoothed variables will be computed for the 30
endogenous variables of your model, this can be very long....


Choose one of the following options:

[1] Consider all the endogenous variables.
[2] Consider all the observed endogenous variables.
[3] Stop Dynare and change the mod file.

options [default is 1] = 2
Loading 90 observations from jpdat.m

Warning: File 'mh_scale_fname' not found.
> In dynare_estimation_1 at 141
In dynare_estimation at 70
In bkk at 296
In dynare at 120
Initial value of the log posterior (or likelihood): -34586.9154

==========================================================
Change in the covariance matrix = 9.9993.
Mode improvement = 33219.8925
New value of jscale = 0.012731
==========================================================
Now I am climbing the hill...
Change in the covariance matrix = 1.0715.
Mode improvement = 26.4723

MODE CHECK

Fval obtained by the minimization routine: 1340.550558

Warning: Matrix is singular to working precision.
> In evaluate_steady_state at 76
In resol at 108
In dynare_resolve at 69
In dsge_likelihood at 247
In mode_check at 127
In dynare_estimation_1 at 487
In dynare_estimation at 70
In bkk at 296
In dynare at 120
Warning: Matrix is singular to working precision.
> In evaluate_steady_state at 76
In resol at 108
In dynare_resolve at 69
In dsge_likelihood at 247
In mode_check at 127
In dynare_estimation_1 at 487
In dynare_estimation at 70
In bkk at 296
In dynare at 120
Warning: Matrix is singular to working precision.
> In evaluate_steady_state at 76
In resol at 108
In dynare_resolve at 69
In dsge_likelihood at 247
In mode_check at 127
In dynare_estimation_1 at 487
In dynare_estimation at 70
In bkk at 296
In dynare at 120
Warning: Matrix is singular to working precision.
> In evaluate_steady_state at 76
In resol at 108
In dynare_resolve at 69
In dsge_likelihood at 247
In mode_check at 127
In dynare_estimation_1 at 487
In dynare_estimation at 70
In bkk at 296
In dynare at 120

RESULTS FROM POSTERIOR MAXIMIZATION
parameters
prior mean mode s.d. t-stat prior pstdev

sigma 1.000 0.5955 0.1777 3.3516 gamm 0.7500
theta 0.500 0.7087 0.0423 16.7511 beta 0.2000
zetainv 0.500 5.0875 0.2630 19.3446 gamm 0.5000
mu 1.000 0.0000 0.0362 0.0002 gamm 1.0000
phi 0.075 0.0618 0.0044 14.0672 gamm 0.0125
gammaw 0.500 0.2121 0.0767 2.7652 beta 0.2000
xiw 0.700 0.8698 0.0225 38.5821 beta 0.1500
gammap 0.500 0.0582 0.0774 0.7525 beta 0.2000
xip 0.700 0.9212 0.0143 64.2317 beta 0.1000
zstar 0.700 0.2720 0.1427 1.9053 norm 0.3000
pistar 3.000 0.7030 0.2733 2.5719 gamm 2.0000
rstar 0.500 1.0232 0.0990 10.3331 gamm 0.2000
phir 0.800 0.6996 0.0282 24.8164 beta 0.1000
phipi 1.500 1.4802 0.0256 57.7946 norm 0.0500
phiy 0.125 -0.0032 0.0112 0.2866 norm 0.0500
rho_z 0.800 0.3186 0.0387 8.2319 beta 0.1000
rho_b 0.800 0.8255 0.0280 29.4316 beta 0.1000
rho_i 0.800 0.7448 0.0385 19.3314 beta 0.1000
rho_g 0.800 0.9652 0.0369 26.1226 beta 0.1000
rho_w 0.800 0.3017 0.0292 10.3508 beta 0.1000
rho_p 0.800 0.5766 0.0241 23.9490 beta 0.1000
rho_r 0.800 0.4844 0.0422 11.4845 beta 0.1000
standard deviation of shocks
prior mean mode s.d. t-stat prior pstdev

e_z 0.005 4.9174 0.3193 15.3990 invg Inf
e_b 0.005 3.2086 1.0827 2.9636 invg Inf
e_i 0.005 6.7290 0.6651 10.1175 invg Inf
e_g 0.005 4.5475 0.4282 10.6210 invg Inf
e_w 0.005 2.2313 0.2204 10.1230 invg Inf
e_p 0.005 0.3194 0.0323 9.8824 invg Inf
e_r 0.005 0.3569 0.0285 12.5454 invg Inf

Log data density [Laplace approximation] is -1411.497607.

MH: Multiple chains mode.
MH: Old _mh files successfully erased!
MH: Old metropolis.log file successfully erased!
MH: Creation of a new metropolis.log file.
MH: Searching for initial values...
MH: Initial values found!

MH: Old mh_history file successfully erased!
MH: Number of mh files : 496 per block.
MH: Total number of generated files : 992.
MH: Total number of iterations : 2000000.
MH: average acceptation rate per chain :
0.2509 0.1652


MCMC Diagnostics: Univariate convergence diagnostic, Brooks and Gelman (1998):
Parameter 1... Done!
Parameter 2... Done!
Parameter 3... Done!
Parameter 4... Done!
Parameter 5... Done!
Parameter 6... Done!
Parameter 7... Done!
Parameter 8... Done!
Parameter 9... Done!
Parameter 10... Done!
Parameter 11... Done!
Parameter 12... Done!
Parameter 13... Done!
Parameter 14... Done!
Parameter 15... Done!
Parameter 16... Done!
Parameter 17... Done!
Parameter 18... Done!
Parameter 19... Done!
Parameter 20... Done!
Parameter 21... Done!
Parameter 22... Done!
Parameter 23... Done!
Parameter 24... Done!
Parameter 25... Done!
Parameter 26... Done!
Parameter 27... Done!
Parameter 28... Done!
Parameter 29... Done!

MH: Total number of Mh draws: 2000000.
MH: Total number of generated Mh files: 496.
MH: I'll use mh-files 248 to 496.
MH: In mh-file number 248 i'll start at line 3849.
MH: Finally I keep 1000000 draws.

MH: I'm computing the posterior mean and covariance... Done!

MH: I'm computing the posterior log marginale density (modified harmonic mean)...
MH: Modified harmonic mean estimator, done!


ESTIMATION RESULTS

Log data density is -1383.460464.

parameters
prior mean post. mean conf. interval prior pstdev

sigma 1.000 0.7963 0.4661 1.1085 gamma 0.7500
theta 0.500 0.6376 0.5204 0.7616 beta 0.2000
zetainv 0.500 2.1381 0.8115 3.5052 gamma 0.5000
mu 1.000 0.0281 0.0000 0.0651 gamma 1.0000
phi 0.075 0.0621 0.0455 0.0792 gamma 0.0125
gammaw 0.500 0.4205 0.0863 0.7457 beta 0.2000
xiw 0.700 0.5154 0.1396 0.8882 beta 0.1500
gammap 0.500 0.1173 0.0127 0.2161 beta 0.2000
xip 0.700 0.8488 0.7574 0.9354 beta 0.1000
zstar 0.700 0.6874 0.2146 1.1676 norm 0.3000
pistar 3.000 0.9630 0.2879 1.5579 gamma 2.0000
rstar 0.500 1.1193 0.7701 1.4720 gamma 0.2000
phir 0.800 0.5900 0.4642 0.7259 beta 0.1000
phipi 1.500 1.4962 1.4139 1.5763 norm 0.0500
phiy 0.125 0.0036 -0.0146 0.0219 norm 0.0500
rho_z 0.800 0.2661 0.1605 0.3718 beta 0.1000
rho_b 0.800 0.7201 0.5385 0.8987 beta 0.1000
rho_i 0.800 0.6948 0.5349 0.8541 beta 0.1000
rho_g 0.800 0.9356 0.8885 0.9864 beta 0.1000
rho_w 0.800 0.6451 0.2332 0.9980 beta 0.1000
rho_p 0.800 0.5844 0.3982 0.7747 beta 0.1000
rho_r 0.800 0.5109 0.3832 0.6358 beta 0.1000

standard deviation of shocks
prior mean post. mean conf. interval prior pstdev

e_z 0.005 4.9605 4.3135 5.6180 invg Inf
e_b 0.005 3.1901 1.8071 4.6859 invg Inf
e_i 0.005 8.9252 5.5533 12.5278 invg Inf
e_g 0.005 5.0579 4.2662 5.8423 invg Inf
e_w 0.005 4.8005 1.8437 8.6175 invg Inf
e_p 0.005 0.4475 0.2788 0.6194 invg Inf
e_r 0.005 0.3688 0.3217 0.4162 invg Inf
??? Error using ==> vertcat
Out of memory. Type HELP MEMORY for your options.

Error in ==> GetPosteriorMeanVariance at 45
z =[z; x2];

Error in ==> dynare_estimation_1 at 953
[oo_.posterior.metropolis.mean,oo_.posterior.metropolis.variance] ...

Error in ==> dynare_estimation at 70
dynare_estimation_1(var_list,dname);

Error in ==> bkk at 296
dynare_estimation(var_list_);

Error in ==> dynare at 120
evalin('base',fname) ;

>>

and
this is my code:
// code

var c rn pi q rk i k u l w y z_b z_i z_g z_w z_p z_r lambda
mc z_z ypot dy_obs dc_obs di_obs dw_obs l_obs pi_obs rn_obs;

varexo e_b e_i e_g e_w e_p e_r e_z;

parameters delta alpha gyss lambdaw lambdap sigma theta chi
zetainv mu phi gammaw xiw gammap xip phir phipi phiy rho_z
rho_b rho_i rho_g rho_w rho_p rho_r zstar lstar pistar rstar;

//fixed parameters
delta = 0.025/4; //depreciation rate, Sugo-Ueda (2008)
alpha = 0.482; //capital share, Sugo-Ueda (2008)
gyss = 0.362; //external demand-output ratio, data mean
lambdaw = 1.1; //wage markup, Sugo-Ueda (2008)
lambdap =1.1;
lstar =1/3;
chi =1.75;

model(linear);

#rss = 1+rstar/100;
#zss = 1+zstar/100;
#beta = zss^sigma/rss;
#wss = (1-alpha)*(1/(1+lambdap))^(1/(1-alpha))
*((zss^sigma/beta-1+delta)/alpha)^(-alpha/(1-alpha));
#rkss = zss^sigma/beta-1+delta;
#klss = zss*alpha*wss/((1-alpha)*rkss);
#kyss = (1+phi)*zss^alpha*klss^(1-alpha);
#iyss = (1-(1-delta)/zss)*kyss;
#cyss = 1-iyss-gyss;

//marginal utility of consumption
(1-theta/zss)*(1-theta/rss)*lambda
= -sigma*(c-theta/zss*(c(-1)-z_z)) + (1-theta/zss)*z_b
+ theta/rss*(sigma*(c(+1)+z_z(+1)-theta/zss*c)
-(1-theta/zss)*z_b(+1));

//Euler equation
lambda = lambda(+1) - sigma*z_z(+1) + rn - pi(+1);

//wage
w - w(-1) + pi - gammaw*pi(-1) + z_z
= zss/rss*(w(+1)-w+pi(+1)-gammaw*pi+z_z(+1))
+ (1-xiw)*(1-xiw*zss/rss)*lambdaw
/(xiw*(lambdaw+chi*(1+lambdaw)))
*(chi*l-lambda-w+z_b) + z_w;

//capital
k = (1-delta)/zss*(k(-1)-z_z) - rkss/zss*u
+ (1-(1-delta)/zss)*i;

//investment
zetainv*(i-i(-1)+z_z+z_i)
= q + zetainv*zss/rss*(i(+1)-i+z_z(+1)+z_i(+1));

//capital utilization
u = mu*(rk-q);

//Tobin's q
q = lambda(+1) - lambda - sigma*z_z(+1)
+ 1/rss*(rkss*rk(+1)+(1-delta)*q(+1));

//market clearing condition
y = cyss*c + iyss*i + gyss*z_g;

//marginal cost
mc = (1-alpha)*w + alpha*rk;

//cost minimization
w - rk = u + k(-1) - l - z_z;

//production function
y = (1+phi)*((1-alpha)*l + alpha*(u+k(-1)-z_z));

//price
pi - gammap*pi(-1) = zss/rss*(pi(+1)-gammap*pi)
+ (1-xip)*(1-xip*zss/rss)/xip*mc + z_p;

// policy rule, r is a nominal interest rate
rn = phir*rn(-1) + (1-phir)*(phipi*(pi+pi(-1)+pi(-2)+pi(-3))/4
+ phiy*(y-ypot)) + z_r;

//potential output
ypot = -(1+phi)*alpha*z_z;

//exogenous shock processes
z_z = rho_z*z_z(-1) + e_z;
z_b = rho_b*z_b(-1) + e_b;
z_i = rho_i*z_i(-1) + e_i;
z_g = rho_g*z_g(-1) + e_g;
z_w = rho_w*z_w(-1) + e_w;
z_p = rho_p*z_p(-1) + e_p;
z_r = rho_r*z_r(-1) + e_r;

// observation equations
dy_obs = zstar + z_z + y - y(-1);
dc_obs = zstar + z_z + c - c(-1);
di_obs = zstar + z_z + i - i(-1);
dw_obs = zstar + z_z + w - w(-1);
l_obs = lstar + l;
pi_obs = pistar + pi;
rn_obs = rstar + pistar + rn;

end;

estimated_params;
sigma, 1.5,,,gamma_pdf, 1, 0.750; //Sugo-Ueda (2008)
theta, 0.4,,,beta_pdf, 0.5, 0.2; //Sugo-Ueda (2008)
zetainv, 7.1,,,gamma_pdf, 0.5, 0.5; //Sugo-Ueda (2008)
mu, 2.1,,,gamma_pdf, 1,1; //Sugo-Ueda (2008)
phi, 0.1,,,gamma_pdf, 0.075, 0.0125; //Sugo-Ueda (2008)
gammaw, 0.3,,,beta_pdf, 0.5, 0.2; //Sugo-Ueda (2008)
xiw, 0.5,,,beta_pdf, 0.7, 0.15; //Sugo-Ueda (2008)
gammap, 0.6,,,beta_pdf, 0.5, 0.2; //Sugo-Ueda (2008)
xip, 0.7,,,beta_pdf, 0.7, 0.1; //Sugo-Ueda (2008)
zstar, ,,, normal_pdf, 0.70, 0.3;
pistar, ,,,gamma_pdf, 3, 2;
rstar, ,,,gamma_pdf, 0.5, 0.2;
phir, 0.7,,,beta_pdf, 0.8, 0.1; //Iiboshi et al. (2006)
phipi, 1.7,,, normal_pdf, 1.5, 0.05; //Iiboshi et al. (2006)
phiy, 0.08,,, normal_pdf, 0.125, 0.05; // Iiboshi et al. (2006)
rho_z, 0.1,,,beta_pdf, 0.8, 0.1;
rho_b, 0.7,,,beta_pdf, 0.8, 0.1;
rho_i, 0.5,,,beta_pdf, 0.8, 0.1;
rho_g, 0.9,,,beta_pdf, 0.8, 0.1;
rho_w, 0.2,,,beta_pdf, 0.8, 0.1;
rho_p, 0.9,,,beta_pdf, 0.8, 0.1;
rho_r, 0.5,,,beta_pdf, 0.8, 0.1;
stderr e_z, 1.6,,,inv_gamma_pdf, 0.005, inf;
stderr e_b, 3.1,,,inv_gamma_pdf, 0.005, inf;
stderr e_i, 4.8,,,inv_gamma_pdf, 0.005, inf;
stderr e_g, 0.4,,,inv_gamma_pdf, 0.005, inf;
stderr e_w, 0.5,,,inv_gamma_pdf, 0.005, inf;
stderr e_p, 0.2,,,inv_gamma_pdf, 0.005, inf;
stderr e_r, 0.1,,,inv_gamma_pdf, 0.005, inf;
end;

varobs dy_obs dc_obs di_obs dw_obs l_obs pi_obs rn_obs;

estimation(datafile = jpdat, mode_check, mh_replic = 2000000 ,
mh_nblocks = 2, mh_jscale = 0.35, prior_trunc=0, mode_compute=6,
bayesian_irf, smoother);

stoch_simul;

shock_decomposition(parameter_set=posterior_mean) dy_obs;
shock_decomposition(parameter_set=posterior_mean) dc_obs;
shock_decomposition(parameter_set=posterior_mean) di_obs;
shock_decomposition(parameter_set=posterior_mean) dw_obs;
shock_decomposition(parameter_set=posterior_mean) l_obs;
shock_decomposition(parameter_set=posterior_mean) pi_obs;
shock_decomposition(parameter_set=posterior_mean) rn_obs;

if mh_replic = 200000 dynare can work it out, but now mh_replic = 2000000, it can not work out.
I use the dyanre 4.3.3 and 4.4.0, both of them, get the same problem.
I do not kown why, can you help me? Thank you very much!
yysun1986
 
Posts: 6
Joined: Sat Oct 26, 2013 1:11 pm

Re: can you help me?

Postby macroresearch123 » Mon Dec 23, 2013 5:02 pm

While I am not familiar with the model and motivation for it, if the question is why 200,000 replications works but 2,000,000, it could relate to the dramatic increase in computational demand. When I have done MCMC -- only twice before, so only a novice at it -- I was using 100,000 for each different chain.
macroresearch123
 
Posts: 90
Joined: Wed Nov 06, 2013 3:28 pm

Re: can you help me?

Postby jpfeifer » Fri Dec 27, 2013 9:30 am

As it says, you are running out of memory:
??? Error using ==> vertcat
Out of memory. Type HELP MEMORY for your options.

Either increase the memory of your computer or use less draws (by e.g. increasing mh_drop when you increase mh_replic)
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: can you help me?

Postby yysun1986 » Wed Jan 01, 2014 3:08 am

thank you very much, happy new year!
yysun1986
 
Posts: 6
Joined: Sat Oct 26, 2013 1:11 pm


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 6 guests