Equation limit using the aim_solver option?

Dear All,

I’m considering porting a large model (1000+ equations) originally solved using Perturbation AIM to dynare (which for some time now has had the aim_solver option in stoch_simul, leading me to think there would be no speed and accuracy penalties involved; and a considerable “user friendliness” bonus).

The issue I encounter is that there appears to be a limit (around the 340 equation mark) when the aim_solver option stops working, and when the mod file throws the following error:

Error in AIM: aimcode=5 : Aim: q(:,right) is singular.
Undefined function or variable ‘aimCode’.

Error in AIM_first_order_solver (line 76)
info(1) = convertAimCodeToInfo(aimCode); %convert to be in the 100 range

Error in stochastic_solvers (line 264)
[dr,info] = AIM_first_order_solver(jacobia_,M_,dr,options_.qz_criterium);

Error in resol (line 144)
[dr,info] = stochastic_solvers(dr,check_flag,M,options,oo);

Error in stoch_simul (line 89)
[oo_.dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);

Error in International_RBC_85_AIM (line 2193)
info = stoch_simul(var_list_);

Error in dynare (line 235)
evalin(‘base’,fname) ;

To illustrate the error I attach three mod files:

  1. The first is a macroprocessor file coding the international RBC model, where the number of countries can be set to any number: INT_RBC_macroprocessor.mod (2.5 KB)

  2. The second is an 84 country processed output (337 equations) which works fine with the aim_solver option: International_RBC_84_AIM.mod (77.5 KB)

  3. The third is an 85 country processed output file, which throws the error reported above: International_RBC_85_AIM.mod (78.4 KB)

So basically, I’m wondering whether there’s something obvious I’m missing, perhaps, and / or an easy way of getting larger models to work with the aim_solver option enabled?

Many thanks in advance for any help / suggestions!
Pawel