Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Automatic regularisation of input variables option in `lmer/glmer` #428

Open
hadjipantelis opened this Issue Jul 8, 2017 · 4 comments

Comments

Projects
None yet
3 participants

I think lmer is great, thank you for your work it! I have a enhancement suggestion:

Would it possible to introduce an input argument normalise such that If TRUE, each fixed-effects variable is standardized to have unit L2 norm, or otherwise it is left alone? (As for example in lars::lars, glmnet::glmnet, etc.) Default should/would be FALSE to ensure backwards compatibility, etc. but I think it will be helpful because: 1. It potentially increases convenience when interpreting results. 2. If users need to rescale variables because of optimisation warnings they can do it automatically, 3. Draws some attention to the relation between mixed effects regression and standard L2-regularisation regression approaches.

bachlaw commented Jul 8, 2017

@bachlaw Thank you for your comment but I think your comment presents a slight misinterpretation of what I asked. For a very simple case what I described is effectively something like: lmer(y ~ x + (1|z), normalise = TRUE) equating to lmer(y ~ scale(x) + (1|z)). Maybe using blme allows the re-expression of the original regression problem in this form but I think that it is far from obvious unless someone really looks into it (plus it would invalidate points 1 & 2 and just satisfy point 3).

Owner

bbolker commented Jul 12, 2017

This already sort of exists, but it's undocumented/experimental and doesn't actually seem to be working at the moment. In principle, control=lmerControl(check.scaleX="silent.rescale")) should do the trick: I think the original intention was to have the parameters automatically translated back to the original scale. In principle, one could also orthogonalize the model matrix ... the glmmADMB package does this ...

@bbolker Thank you for your answer. I fully agree, potentially orthonormalising the matrix would be the most proper method. I suggested normalise as the "standard option" currently implemented in other popular regression packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment