stoch_simul:problems with the second-order approximation

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.

stoch_simul:problems with the second-order approximation

Postby andwes » Thu Jan 31, 2013 1:45 pm

Hi,

When trying to solve a model using a second-order approximation (I'm using matlab 2011a and either dynare 4.3.1 or 4.1.0) the simulation breaks down because I get problems with "std::bad_alloc" - full error message see below. The model runs when using a first-order approximation, although in dynare 4.3.1 it complains about that the "Matrix is close to singular or badly scaled" (RCOND = 3.139880e-017) but the program eventually runs through (dynare 4.1.0 runs without problems). My guess is that the problems are either due to the singularity problems or to memory problems - the model is quite large.

Does anyone has an idea about what might be the cause of the "std::bad_alloc" problem?

Thanks

Andreas Westermark

Error message:

Configuring Dynare ...
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Bytecode evaluation.
[mex] k-order perturbation solver.
[mex] k-order solution simulation.

Starting Dynare (version 4.1.0).
Starting preprocessing of the model file ...
Found 7673 equation(s).
Evaluating expressions...done
Computing static model derivatives:
- order 1
Computing dynamic model derivatives:
- order 1
- order 2
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
andwes
 
Posts: 20
Joined: Wed Mar 17, 2010 2:17 pm

Re: stoch_simul:problems with the second-order approximation

Postby jpfeifer » Thu Jan 31, 2013 3:48 pm

Hi, could you check, whether the problem persists with 4.3.2. If yes, please post or send me the mod-file so we can check if there is a bug.
------------
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: stoch_simul:problems with the second-order approximation

Postby andwes » Fri Feb 01, 2013 12:58 pm

I got the same results with 4.3.2, unfortunately. There seems to be some problem with uploading files - maybe because of the size. Do you have an e-mail address that I can send it to?

Best

Andreas
andwes
 
Posts: 20
Joined: Wed Mar 17, 2010 2:17 pm

Re: stoch_simul:problems with the second-order approximation

Postby SébastienVillemot » Thu Feb 07, 2013 1:34 pm

This error message means that the Dynare preprocessor ran out of memory. Under Windows, we distribute a 32-bit binary, which means that it is limited to 4Gb of RAM. On my machine, I let the program run until it took 7Gb of RAM, then killed it because it was making my machine unusable.

Essentially your model is too big and very nonlinear, so that 2nd order derivatives are huge expressions. Even if we were able to improve the preprocessor so that it consumes less memory, MATLAB would probably be unable to handle the dynamic file.

I think you only have two options: stick at first order, or simplify your model.
Sébastien Villemot
Economist at OFCE – Sciences Po
SébastienVillemot
 
Posts: 706
Joined: Fri Dec 07, 2007 2:29 pm
Location: Paris, France


Return to Dynare help

Who is online

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