Problems with comparisons

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.

Problems with comparisons

Postby kindofascholar » Thu Feb 26, 2015 3:49 pm

Hi,

A coauthor and I are sharing a .mod file and an .m file containing data to estimate a model. The files are exactly the same and our versions of Dynare (4.4.3) are exactly the same. However, I am able to estimate the model on my laptop, but he is not able to on his desktop? Know any reason why this might occur? Thanks!
kindofascholar
 
Posts: 8
Joined: Thu Feb 26, 2015 3:37 pm

Re: Problems with comparisons

Postby jpfeifer » Thu Feb 26, 2015 7:48 pm

Generally, this is not supposed to happen.

If your model has a singularity and you are using different operating systems (64 vs 32 bit), that could happen. Run model_diagnostics to see if anything turns up on your machine. Alternatively, if one you is using a really old Matlab version, that one could have a different random number generator.
------------
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: Problems with comparisons

Postby kindofascholar » Thu Feb 26, 2015 11:03 pm

Thanks for the response. Both computers have 64B. I've tried model_diagnostics(M_,options_,oo_) but it doesn't give me any output in either of the computers.
kindofascholar
 
Posts: 8
Joined: Thu Feb 26, 2015 3:37 pm

Re: Problems with comparisons

Postby jpfeifer » Fri Feb 27, 2015 7:15 am

What do you mean with
I am able to estimate the model on my laptop, but he is not able to on his desktop
------------
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: Problems with comparisons

Postby kindofascholar » Mon Mar 02, 2015 7:03 pm

I mean that I run the code on my computer and it works. He runs the identical code on his computer and it does not work.
kindofascholar
 
Posts: 8
Joined: Thu Feb 26, 2015 3:37 pm

Re: Problems with comparisons

Postby jpfeifer » Mon Mar 02, 2015 7:35 pm

I already inferred that. But what is the error message?
------------
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: Problems with comparisons

Postby kindofascholar » Wed Mar 04, 2015 4:12 am

Hi, jpfeifer. Thanks for the help. Here is the error.

Error using lnsrch1 (line 71)
Some element of Newton direction isn't finite. Jacobian maybe singular or
there is a problem with initial values

Error in solve1 (line 107)
[x,f,fvec,check]=lnsrch1(xold,fold,g,p,stpmax,func,j1,j2,varargin{:});

Error in dynare_solve (line 150)
[x,info]=solve1(func,x,j1(r(i):r(i+1)-1),j2(r(i):r(i+1)-1),jacobian_flag,
...

Error in evaluate_steady_state (line 66)
[ys,check] = dynare_solve([M.fname '_static'],...

Error in resol (line 104)
[dr.ys,M.params,info] =
evaluate_steady_state(oo.steady_state,M,options,oo,0);

Error in dynare_resolve (line 69)
[dr,info,Model,DynareOptions,DynareResults] =
resol(0,Model,DynareOptions,DynareResults);

Error in dsge_likelihood (line 256)
[T,R,SteadyState,info,Model,DynareOptions,DynareResults] =
dynare_resolve(Model,DynareOptions,DynareResults,'restrict');

Error in gmhmaxlik (line 157)
logpo2 = - feval(ObjFun,proposal,varargin{:});

Error in dynare_estimation_1 (line 437)
[xparam1,PostVar,Scale,PostMean] = ...

Error in dynare_estimation (line 89)
dynare_estimation_1(var_list,dname);

Error in medscale_est (line 408)
dynare_estimation(var_list_);

Error in dynare (line 180)
evalin('base',fname) ;
kindofascholar
 
Posts: 8
Joined: Thu Feb 26, 2015 3:37 pm

Re: Problems with comparisons

Postby jpfeifer » Wed Mar 04, 2015 12:58 pm

Dynare did encounter a parameter draw where the steady state could not be computed. Does this happen at the beginning of the MCMC?
------------
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: Problems with comparisons

Postby kindofascholar » Wed Mar 04, 2015 3:38 pm

It happens during the tuning of the scale parameter after the second round of the estimation of the covariance matrix. The first round gives this:

==========================================================
Change in the covariance matrix = 8.9016.
Mode improvement = 465.036
New value of jscale = 0.0065414
==========================================================

In the process we get a lot of "SOLVE: maxit has been reached".
kindofascholar
 
Posts: 8
Joined: Thu Feb 26, 2015 3:37 pm

Re: Problems with comparisons

Postby jpfeifer » Thu Mar 05, 2015 10:30 am

Try increasing maxit to alleviate problems in finding the steady state. E.g, call
Code: Select all
steady(maxit=1000);

before the estimation command.
------------
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: Problems with comparisons

Postby kindofascholar » Thu Mar 05, 2015 6:19 pm

No luck. Same thing as before. I tried with maxit=1000, 2000, and 5000.
kindofascholar
 
Posts: 8
Joined: Thu Feb 26, 2015 3:37 pm

Re: Problems with comparisons

Postby jpfeifer » Fri Mar 06, 2015 7:19 am

Ok. Could you provide me with files to replicate the problem?
------------
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: Problems with comparisons

Postby kindofascholar » Wed Mar 18, 2015 4:01 pm

Thanks, jpfeifer! We actually have the code running on both computers now. However, now when we run the estimation, we get slightly different results on each of our computers. We are not sure what the problem is. Here is the code. The m file contains the parameters. Thanks for your help!
Attachments
medscale_est_new.mod
(6.22 KiB) Downloaded 30 times
quant_lab_med_new.m
(901 Bytes) Downloaded 29 times
kindofascholar
 
Posts: 8
Joined: Thu Feb 26, 2015 3:37 pm

Re: Problems with comparisons

Postby jpfeifer » Wed Mar 18, 2015 8:51 pm

The datafile is missing.
------------
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: Problems with comparisons

Postby kindofascholar » Wed Mar 18, 2015 11:22 pm

Sorry about that!
Attachments
real_dat.m
(32.15 KiB) Downloaded 26 times
kindofascholar
 
Posts: 8
Joined: Thu Feb 26, 2015 3:37 pm


Return to Dynare help

Who is online

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