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

another predict(*, newd) error #257

Closed
mmaechler opened this issue Nov 22, 2014 · 2 comments
Closed

another predict(*, newd) error #257

mmaechler opened this issue Nov 22, 2014 · 2 comments

Comments

@mmaechler
Copy link
Member

From an e-mail to lme4-authors from Patrick Breheny (U.Iowa) - thank you -
example slightly simplified:

require(lme4)
data(Orthodont,package="nlme")
Orthodont <- within(Orthodont, nsex <- as.numeric(Sex == "Male"))

fm1 <- lmer(distance ~ age + (age|Subject) + (0 + Sex|Subject), data=Orthodont)
## (warning about identifiability, not a problem)
p1 <- predict(fm1, Orthodont) # works fine
## but  result  is *WRONG*  [this is "the same bug" as the problem below !]
all.equal(p1, predict(fm1)) # 0.03218


fm2 <- lmer(distance ~ age + (age|Subject) + (0 + nsex|Subject), data=Orthodont)
predict(fm2, Orthodont) #
## Error in t(.Call(Csparse_dense_crossprod, y, x)) :
##    error in evaluating the argument 'x' in selecting a method for
## function 't': Error: Cholmod error 'X and/or Y have wrong dimensions' at
## file ../MatrixOps/cholmod_sdmult.c, line 90
traceback()

and the bug is -- once more -- in mkNewReTrms() which returns a wrong (length) b vector
which then gives an error in b %*% Zt

@mmaechler
Copy link
Member Author

It's worse: I've edited the example code above: When debugging, I found that also the first case
works wrongly... but --unfortunately-- does not give an error, but a wrong result...
--> we have a bad problem, so I call this release critical.

@bbolker
Copy link
Member

bbolker commented Nov 22, 2014

wow, that was a quick fix ...

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

No branches or pull requests

2 participants