cannot allocate smatrix(fs)

Welcome to the forum for runmlwin users. Feel free to post your question about runmlwin here. The Centre for Multilevel Modelling take no responsibility for the accuracy of these posts, we are unable to monitor them closely. Do go ahead and post your question and thank you in advance if you find the time to post any answers!

Go to runmlwin: Running MLwiN from within Stata >> http://www.bristol.ac.uk/cmm/software/runmlwin/
Post Reply
emmaanderson
Posts: 4
Joined: Mon May 16, 2016 8:10 am

cannot allocate smatrix(fs)

Post by emmaanderson »

Hi there

I'm trying to run the following model:

fracpoly: regress logfrailty age50
fracgen age50 2 2, replace

recast float age50_1, force
recast float age50_2, force
runmlwin log_frailty cons age50_1 age50_2 female , ///
level1(swave: cons age50_1 age50_2, reset(none)) ///
level2(id: cons age50_1 age50_2, reset(none) residuals(id_res) ) ///
level3(hhcluster:cons, reset(none) ) ///
level4(country:cons, reset(none) ) ///
nopause maxiterations(100)

My sample size is 98,521. I am getting the following error message:

cannot allocate smatrix(fs)

When I click 'OK' I get:

error while obeying the batch file
C:\Users\epela\AppData\Local\Temp\ST_00000008.tmp at line number 62: STAR
cannot allocate smatrix(fs)

I found this previous thread:
https://www.cmm.bristol.ac.uk/forum/viewtopic.php?t=562

Tried replacing the runmlwin.ado file text from:

file write `macro1' "OPTS 0" _n

to

file write `macro1' "OPTS 1" _n

This didn't work. I also tried adding "mlwinsettings(size(536000) levels(5) columns(1500) variables(300) tempmat)" and played with those to no avail.

Any idea what the problem might be?

Thanks :)

Emma
ChrisCharlton
Posts: 1384
Joined: Mon Oct 19, 2009 10:34 am

Re: cannot allocate smatrix(fs)

Post by ChrisCharlton »

Note that in the most recent version there is a new option under mlwin_setting (optimat) that you can use instead of having to edit the runmlwin.ado file. For details see the -runmlwin- help file. I would therefore suggest that as a first step you update to the most recent version of -runmlwin- and use this option to see whether you get the same behaviour. If so it might be worth using the 64-bit scripting version of the software (mlnscript.exe in the x64 subdirectory where you installed MLwiN) to see whether having more memory helps. If neither of these work then it may just be that your group sizes are too large for MLwiN to handle and you may need to subsample them.
emmaanderson
Posts: 4
Joined: Mon May 16, 2016 8:10 am

Re: cannot allocate smatrix(fs)

Post by emmaanderson »

I am using the most up to date version - I un- and re-installed this morning. Tried the optimat option and i'm using the x64 version but still getting the same errors. The odd thing is that this model was running a few weeks ago..

Hey ho, thanks for the advice.
ChrisCharlton
Posts: 1384
Joined: Mon Oct 19, 2009 10:34 am

Re: cannot allocate smatrix(fs)

Post by ChrisCharlton »

If it was running a few weeks ago can you think of anything that has changed since then (e.g. new or updated software)? If you have access to another computer it might also be worth testing there to see whether you get the same error.
johkle000
Posts: 1
Joined: Tue May 24, 2016 4:52 pm

Re: cannot allocate smatrix(fs)

Post by johkle000 »

Dear all,

I am confronted with a similar problem -the fs matrix cannot be allocated- and would very much appreciate your help.
My sample size is roughly 60.000; I am estimating 20 level3 and 130 level2 groups (which is not ideal, but the structure of the data).
The dependent variable is binary, so I am using the logit:

gen n =_n
gen cons =1
sort Country Region n
recast float var1 var2 [....] , force
runmlwin BINARY cons var1 var2 [....] , level3(Country: cons) level2(Region: cons ) level1(n) discrete(distribution(binomial) link(logit) denominator(cons)) nopause maxiterations(500)

My questions are:
1) Can I use level1 controls if my dependent variable is binary? - I read somewhere that this is not possible, which would render MLWIN for me less useful.
2) Can I add level2 predictors like shown below if I am interested in the intercept only model?
runmlwin BINARY cons var1 var2 [....] var1level2 var2level2 [...] , level3(Country: cons) level2(Region: cons ) level1(n) discrete(distribution(binomial) link(logit)

Thank you very much for your time!!
Best
Jo
Post Reply