I need to buy a new computer because tasks I am running with R are taking 2-4 days to run (MCMC, multiple imputations) so I am looking for some advice on what to prioritise - more RAM, faster CPU speed, more L3 cache, etc. Is it OK to ask about this ?
2 Answers
You seem to be asking a hardware question requiring statistical programming knowledge.
SuperUser's faq explicitly states that hardware-related topics are on-topic.
CrossValidated's faq makes no mention of hardware-related questions as being on-topic. The closest it gets is to say that programming questions requiring statistical expertise to understand or answer are on-topic.
StackOverflow's faq makes no explicit mention of hardware-related questions as being on-topic, but does state that "practical, answerable problems that are unique to the programming profession" are on-topic.
Computational Science's faq states that "computational methods used in technical disciplines" are on topic.
Your question is certainly on-topic at SuperUser, but because it requires statistical programming knowledge, it might not be exposed to an audience with the expertise that you desire. For CrossValidated, your question is a hardware question requiring statistical programming knowledge, as opposed to a programming question requiring statistical programming knowledge. I think it is technically off-topic. For StackOverflow, since your question is a hardware question requiring statistical programming expertise, it is unique to the programming profession. I think this makes it on-topic. Finally, Computational Science's faq is a bit vague to me, but a search for "hardware" on that site brings up a few questions in the same vein as yours (e.g. here, here, and here).
Before Computational Science went into beta, I probably would have asked a question like yours on StackOverflow. You likely still can and will get good answers. However, Computational Science seems more geared toward your question.
-
2$\begingroup$ There is also a computational science SE to consider $\endgroup$ Commented Jun 23, 2012 at 4:00
-
$\begingroup$ @David: Thanks, I had forgotten about computational science. I think it is the best fit for OP after all. $\endgroup$– jthetzelCommented Jun 23, 2012 at 13:40
Joe, you are a statistician, and must have taken courses on experiment design. Design an experiment to see how your programs scale on the existing architecture first: take a typical data set, decrease it in size by factors of 3 and 10, and increase it in size by factors of 3 and 10. Likewise, find a way to wary the computational complexity. This may not be so easy, although increasing/decreasing number of variables in MI and number of parameters in MCMC should be a step in that direction. Come up with a factorial design and time it.
One would naturally expect the computational time to grow with the problem size and difficulty. My experience timing my own Stata factor analysis code was that $$T \sim n^{0.7} p^{2.3}$$ where $n$ was the sample size and $p$ was the dimensionality of the problem. The exponent for the latter is actually the best existing rate for matrix inversion which is one of the intense tasks in the program. The exponent on the sample size is intriguing, as I was expecting the time to be linear in the sample size; this may have to do with the small sample likelihoods being more weird and difficult to optimize, though.
If you start seeing huge increases in computing time beyond these natural power laws, you must be hitting the memory limits, which would be an indication that you need larger RAM. If you don't see any issues with the memory size, for the problems you will likely be working on, you would be far much better off buying a faster chip with more parallel threads.
-
4
-
-
2
-
$\begingroup$ Thank you. dimensionality of the problem is the number of predictors in the model ? $\endgroup$– Joe KingCommented Jun 29, 2012 at 20:05
-
2$\begingroup$ If you have a regression-like model, then you only need to inverse the $p\times p$ matrix once. However, in my factor analysis/multivariate problem, I had to compute the $p\times p$ matrix for every evaluation of the likelihood, and that's what took the toll. So whether the number of variables is a good predictor of the computing time really depends on the model that you are dealing with. If you are building some regression trees, the measure of complexity would probably be some combination of the # of variables and the # of splits. $\endgroup$– StasKCommented Jul 5, 2012 at 15:21
MCMCglmm()
function in theMCMCglmm
package and one single call to that takes around 6 hours and I have many models to run, so I don't think I can obtain any speed-up by coding..... $\endgroup$