I was attempting to run a multi-level exponential survival model (-mestreg-), but it failed with a series of Mata error messages, of which the salient one is the first:
Code:
                     J():  3900  unable to allocate real <tmp>[3478219,2628]
I understand this means the OS would not allocate memory for a matrix that was needed. What I do not understand is where the dimensions of that matrix come from. My estimation sample size is 3,882,861 observations. These are nested in 3,478,219 level 2 groups, which are nested in 15,283 level 3 groups. The model includes random intercepts at those levels, and no random slopes. The model explanatory variables have 46 df. (And, of course, there is the survival time and the failed/censored indicator.)

It is clear where the 3478219 dimension comes from: it's the number of level 1 groups. But where does the 2628 come from? If I am unable to arrange to get this run on a machine with more RAM, I want to draw a subsample to do the estimation on, but I want to try to do it strategically, and I don't know how I should balance removing observations from within level 1 groups, with removing level 2 groups, and removing level 3 groups.

Does anybody know where the 2628 comes from? I tried looking through the -melogit- code but could find nothing relevant there--I suspect it arises inside some precompiled Mata routines.