Page 1 of 1

Multisector model: too many variables for matlab

PostPosted: Mon May 25, 2015 3:59 pm
by michaweb
Dear all,

I'm currently running a multisector Calvo model. The pre-processing works perfectly but once I run the generated m-files I run into issues with Matlab. Specifically, I get the following error message:

Error using assignin
The current workspace already has too many variables; there is no room for "w_186_50",

where w_186_50 is a parameter. I initialize the parameters using the following code:

@#for i in sectors
parameters

@#for j in sectors
w_@{i}_@{j}
@#endfor

@#endfor

where sector is 350. I assign values according to

@#for i in 1:num
@#for j in 1:num
set_param_value('w_@{i}_@{j}',weights_sector(@{(i-1)*num+j}));
@#endfor
@#endfor

where weights_sector is a 1 x (350 times 350) vector.

Is there a way to to just define a paramter vector W and then access different entries in the model section?

I also thought of way to manipulating the ex-post generated m files.

Any (alternative) suggestions are highly appreciated.

Many thanks in advance!
Michael

Re: Multisector model: too many variables for matlav

PostPosted: Tue May 26, 2015 6:15 pm
by jpfeifer
Unfortunately, that is currently not possible. You are running into the limit of http://stackoverflow.com/questions/20328159/matlab-variable-count-limit

Re: Multisector model: too many variables for matlav

PostPosted: Wed May 27, 2015 8:51 am
by michaweb
Hi Johannes,

thank you so much for your reply!

Is there a way to directly modify the m files generated by dynare?
The pre-processing works perfectly and all the m files are generated so I thought I could possibly directly manipulate the m files.
Unfortunately, I do not really have any experience with that but thought that it should in principle be possible.

I'm looking forward to your comments and thoughts!

Thanks,
Michael

Re: Multisector model: too many variables for matlav

PostPosted: Wed May 27, 2015 4:32 pm
by jpfeifer
You would need to manipulate the main m-file, i.e. the one with the same name as the mod-file. There, you can delete the lines writing the parameters to the workspace, but given the size of your model, this should be infeasible to do manually. See https://github.com/DynareTeam/dynare/issues/946