I’m currently attempting to do a second order approximation of a relatively large system (around 60 variables, 2500 parameters, and fairly complicated model expressions) and I get the following error message:
"Error using feval
The current workspace already has too many variables; there is no room for “T854468”.
Error in stochastic_solvers (line 107)
[junk,jacobia_,hessian1] = feval([M_.fname ‘_dynamic’],z(iyr0),…
Error in resol (line 141)
[dr,info] = stochastic_solvers(dr,check_flag,M,options,oo);
Error in stoch_simul (line 82)
[oo_.dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
Error in aggregateDynamics (line 8010)
info = stoch_simul(var_list_);
Error in dynare (line 223)
Error in mainFile (line 119)
dynare aggregateDynamics minimal_workspace"
The error comes after the preprocessing is completed and the steady state is computed (using an external _steadystate.m file) without error. So my guess is that the preprocessor creates a lot of temporary terms as part of the differentiation routine (see slide 59 of “preprocessor.pdf” in the doc folder), and when Matlab evaluates the _dynamic.m file it runs out of room in the workspace. I can compute the first order approximation no problem, so the extra terms must be coming from the second order derivatives.
If anyone has any advice for me, I would really appreciate it! Some ideas I had: are there ways to reduce the amount of temporary terms created in the preprocessor? (I think that these temporary terms are created because they are common components in the derivatives) Or, is there a way to write my system to minimize the number of temporary terms created? Or, is there a way to clear the unnecessary terms from Matlab’s memory, without messing up the final evaluation of the derivatives? Or, a way to increase the size of Matlab’s workspace? I’m already using the minimal_workspace option in the unstable snapshot by invoking “dynare filename.mod minimal_workspace” in Matlab.
As a last resort, I am thinking of feeding in my own derivative matrices, and calling Dynare’s functions to do the rest of the model computation and analysis.