Multisector model: too many variables for matlab

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.

Multisector model: too many variables for matlab

Postby michaweb » Mon May 25, 2015 3:59 pm

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
michaweb
 
Posts: 2
Joined: Wed Mar 25, 2015 6:37 pm

Re: Multisector model: too many variables for matlav

Postby jpfeifer » Tue May 26, 2015 6:15 pm

Unfortunately, that is currently not possible. You are running into the limit of http://stackoverflow.com/questions/20328159/matlab-variable-count-limit
------------
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: Multisector model: too many variables for matlav

Postby michaweb » Wed May 27, 2015 8:51 am

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
michaweb
 
Posts: 2
Joined: Wed Mar 25, 2015 6:37 pm

Re: Multisector model: too many variables for matlav

Postby jpfeifer » Wed May 27, 2015 4:32 pm

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
------------
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


Return to Dynare help

Who is online

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