Page 1 of 1

cannot allocate smatrix(fs)

Posted: Mon May 16, 2016 8:19 am
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

Re: cannot allocate smatrix(fs)

Posted: Mon May 16, 2016 9:08 am
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.

Re: cannot allocate smatrix(fs)

Posted: Mon May 16, 2016 9:18 am
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.

Re: cannot allocate smatrix(fs)

Posted: Mon May 16, 2016 9:25 am
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.

Re: cannot allocate smatrix(fs)

Posted: Tue May 24, 2016 5:02 pm
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