the mlm was really slow for multiple conditions or when I ran on individual samples.
I noticed that it calls the lm function for each conditions one-by-one, but this is not needed, because lm can fit multiple conditions at once. This is actually much faster, because then it does not need to run QR-decomposition N times (if there are N sampoles), but only once.
Checked on my data, the results are identical to the old version within machine precision.
Checked with a single condition and also with multiple sampels too.
Let me know if something else is missing before merging.
hey,
the
mlm
was really slow for multiple conditions or when I ran on individual samples. I noticed that it calls thelm
function for each conditions one-by-one, but this is not needed, becauselm
can fit multiple conditions at once. This is actually much faster, because then it does not need to run QR-decomposition N times (if there are N sampoles), but only once.Checked on my data, the results are identical to the old version within machine precision. Checked with a single condition and also with multiple sampels too. Let me know if something else is missing before merging.
best, Attila