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

Error 'a' (<dimension1> x 1) must be square #22

Closed
fweber144 opened this issue Mar 11, 2022 · 3 comments
Closed

Error 'a' (<dimension1> x 1) must be square #22

fweber144 opened this issue Mar 11, 2022 · 3 comments

Comments

@fweber144
Copy link

fweber144 commented Mar 11, 2022

For some models fitted by mclogit::mblogit(), I get the error

Error in solve.default(X[[i]], ...) : 'a' (<dimension1> x 1) must be square

thrown by mclogit:::PQLMQL_innerFit(). (The <dimension1> can be 3, for example.)

I think the problematic line is

S.k <- diag(x=S.k,nrow=d)
because, if S.k is a matrix there, then diag() returns a vector containing the diagonal elements. Perhaps that line was supposed to read

S.k <- diag(x=diag(S.k),nrow=d)

instead? But I don't know anything about the mathematical details of this line, so my guess might be completely wrong.

And I'm not sure, but perhaps this is the same bug as in #21?

Note that this issue occurs with both, the current CRAN version 0.8.7.3 as well as with the current GitHub version at commit 7f47d53 installed via devtools::install_github("melff/mclogit",subdir="pkg").

@Zhiwen-Owen-Jiang
Copy link

I found this bug either. The code that previously I could run failed.

@melff
Copy link
Owner

melff commented Apr 10, 2022

This appears to be fixed in release 0.9.4.

@melff melff closed this as completed Apr 10, 2022
@fweber144
Copy link
Author

Thanks, this seems indeed to be fixed. However, I now get an error from predict.mmblogit() which I'll open a new issue for.

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

3 participants