-
Notifications
You must be signed in to change notification settings - Fork 114
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
Fix QR based fitting #559
Fix QR based fitting #559
Conversation
33d1584
to
35c3e94
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #559 +/- ##
==========================================
- Coverage 90.11% 89.95% -0.17%
==========================================
Files 8 8
Lines 1123 1105 -18
==========================================
- Hits 1012 994 -18
Misses 111 111 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
src/linpred.jl
Outdated
end | ||
p.delbeta[1:rnk] = R \ (p.qr.Q'*r̃)[1:rnk] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe
p.delbeta[1:rnk] = R \ (p.qr.Q'*r̃)[1:rnk] | |
mul!(view(p.delbeta, 1:rnk), view(p.qr.Q, :, 1:rnk)', r̃) | |
ldiv!(R, view(p.delbeta, 1:rnk)) |
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't make a view into Q
, see above, but we can make a view into the result.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've addressed your comments
src/linpred.jl
Outdated
end | ||
p.delbeta[1:rnk] = R \ (p.qr.Q'*r̃)[1:rnk] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't make a view into Q
, see above, but we can make a view into the result.
37249f5
to
2b61e90
Compare
@devmotion I finally found a way to download the test dataset reliably so this one should be good to go. |
Avoid erroring out for low rank design matrices when dropcollinear=false. Avoid unnecessary triangular solves. Avoid indexing in the Q. Avoid slicing R matrix in a way that triggers a minimum norm solution. Remove unnecessary temporaries.
054f910
to
94f7198
Compare
Avoid erroring out for low rank design matrices when dropcollinear=false.
Avoid unnecessary triangular solves. Avoid indexing in the Q.
Avoid slicing R matrix in a way that triggers a minimum norm solution.
Remove unnecessary temporaries.
Fixes #558
I removed the white space so please review with https://github.com/JuliaStats/GLM.jl/pull/559/files?w=1