Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it worthwhile having a general initializeResp function? #8

Open
dmbates opened this issue Sep 3, 2013 · 2 comments
Open

Is it worthwhile having a general initializeResp function? #8

dmbates opened this issue Sep 3, 2013 · 2 comments

Comments

@dmbates
Copy link
Member

dmbates commented Sep 3, 2013

The initializeResp function has an incredible amount of crud in it because of design of the glm family objects and in particular the special case of a binomial response specified as a two-column matrix of counts. At present, it is called from plsform but doing so provides absolutely no benefit and it comes are great cost of adding a family argument that should not be there. There is nothing to be gained by adding a family argument to plsform, calling initializeResp and then extracting y, weights and offset from the result yet there is a lot to be lost in terms of a massive increase in complexity encountered when reading the code.

All the messing around with an environment in initializeResp is caused by the brain-dead design of the initialize expression in the glm family argument. Why introduce this totally unnecessary complexity into LMMs when, by definition, a non-trivial family cannot occur.

I'm grumbling about this, fully recognizing that I was the one who created this mess in lme4, but that doesn't mean we have to propagate the mistakes of my youth into lme4pureR :-)

@stevencarlislewalker
Copy link
Member

"There is nothing to be gained by adding a family argument to plsform" This is a good point. I agree. I like the idea of having formula parsing be identical for both pls and pirls.

"All the messing around with an environment in initializeResp is caused by the brain-dead design of the initialize expression in the glm family argument. Why introduce this totally unnecessary complexity into LMMs when, by definition, a non-trivial family cannot occur." This is a good point. Do you have any ideas about how to get the family information into pirls?

Sorry for being awol over the last few days. I'm ramping up for teaching.

Hopefully I'll get some time on the weekend to do a bit of an lme4pureR push.

@dmbates
Copy link
Member Author

dmbates commented Sep 3, 2013

@stevencarlislewalker Thanks for responding in a calm way to my grumbling and sorry about distracting you at the beginning of classes. (As an Emeritus faculty member I must admit that this is my favorite time of year, in part because I can watch everyone else ramp up for classes while I sit back in the late summer sun and read a novel.)

When you say, "I like the idea of having the formula parsing be identical for both pls and pirls." I take it that you are okay with the idea of initializeResp being called by the pirls code only. Is that the case? If so, I am happy to move initializeResp to R/pirls.R and revert the evaluation of y, weights and offset in the list created by plsform (or whatever we end up calling it).

When you ask about how to get the family information into pirls I think we are stuck doing what we did in lme4. All I want is to be able to avoid using initializeResp in the plsform function and have it called, or the code inlined, whichever makes sense, in pirls.

Do you want me to create a branch and implement what I have been considering so that you can see it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants