lme4qtl icon indicating copy to clipboard operation
lme4qtl copied to clipboard

speed up relmatLmer?

Open GuoanQi1996 opened this issue 10 months ago • 1 comments

Hi, @variani Fitting a linear mixed model with kinship as random effect is a quite time-consuming task. I am trying to apply the relmatLmer on a dataset with about 500 samples and 30K "variants" (not the numeric variable but factorial), by fitting Model1 = relmatLmer(PHE ~ PC1+PC2+PC3+PC4+PC5+(1|ID), data, relmat = list(ID = Kin),REML=F,control = lmerControl(optimizer = "nloptwrap",optCtrl=list(xtol_abs=1e-6, ftol_abs=1e-6),calc.derivs = F)) and turn into a loop Model2 = update(Model1, .~.+(1|G)) which G is a single factorial variant. Then two models were compared by anova to get the significance of G. This takes about 20 hours, even i paralleled the loop by foreach in package doSNOW with 40 threads.

I have already followed some methods on the stack overflow to improve the efficiency, but the time used is still not ideal. Is there any way to speed up the regression?

GuoanQi1996 avatar Apr 11 '24 13:04 GuoanQi1996

Hi,

Do you have any suggestions on how to improve lme4qtl for your type of variance-component test? Any reference would be helpful.

Your Model2 doesn't account for mean differences among levels of G. Is it a reasonable assumption?

Best, Andrey

variani avatar Apr 25 '24 20:04 variani