-
Notifications
You must be signed in to change notification settings - Fork 115
Adding PowerLink link function in GLM #474
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #474 +/- ##
==========================================
+ Coverage 85.12% 86.94% +1.81%
==========================================
Files 7 7
Lines 827 835 +8
==========================================
+ Hits 704 726 +22
+ Misses 123 109 -14
Continue to review full report at Codecov.
|
Test was failing in Julia Nightly as: 1) GLM.linkinv(InverseLink(), 10) was 0.01 while GLM.linkinv(PowerLink(-1), 10) was 0.010000000000000002 2) GLM.linkinv(InverseSquareLink(), 10) was -10.01 while GLM.linkinv(PowerLink(-2), 10) was -0.010000000000000002 Rounding off to 2 digits should solve this. Note: These tests were passing in other versions of Julia.
…ed it for the docs
…(-2), 10 to 2 digits
|
We are testing: GLM.mueta(InverseLink(), 10) == GLM.mueta(PowerLink(-1), 10)While this is passing in Julia 1.0, it is failing in Julia nightly, and we are getting the following error: I have done rounding, so this test passes. |
|
Look at some of the tests in Julia's LinearAlgebra or other numerical packages on how to handle this in tests. |
Instead of |
|
We can use isapprox, but in this case, rounding seems more apt. I wanted to point out if there is a possible bug in Julia nightly that we should isolate and report. |
|
This is not indicative of a bug in Julia nightly. @mousum-github 's suggestion to use |
nalimilan
left a comment
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.
Thanks!
Correcting order of PowerLink, ProbitLink, SqrtLink. Co-authored-by: Milan Bouchet-Valat <nalimilan@club.fr>
Using ≈ instead of isapprox. Co-authored-by: Milan Bouchet-Valat <nalimilan@club.fr>
Using alphabetical order in references. Co-authored-by: Milan Bouchet-Valat <nalimilan@club.fr>
Writing the example description in plain text. Co-authored-by: Milan Bouchet-Valat <nalimilan@club.fr>
Removing extra space to be consistent with the style. Co-authored-by: Milan Bouchet-Valat <nalimilan@club.fr>
Using a better variable name for 1 by lambda. Co-authored-by: Milan Bouchet-Valat <nalimilan@club.fr>
Using inline function. Co-authored-by: Milan Bouchet-Valat <nalimilan@club.fr>
Making the doctest code concise. Co-authored-by: Milan Bouchet-Valat <nalimilan@club.fr>
Removing the R code. Co-authored-by: Milan Bouchet-Valat <nalimilan@club.fr>
Removing test of hashes. Co-authored-by: Milan Bouchet-Valat <nalimilan@club.fr>
…few more metrics to test, also replaced all `=` by `≈` for real numbers
|
cc @dmbates |
Since we are storing the link - the `GLM.Link` function can be defined uniformly for all link functions Co-authored-by: Milan Bouchet-Valat <nalimilan@club.fr>
Changing the sentence to make it compact Co-authored-by: Milan Bouchet-Valat <nalimilan@club.fr>
…er after d (distribution) and changed in corresponding constructor, remove updateμ! function for PowerLink and modified general updateμ! function.
Adding break line and removing full stop Co-authored-by: Milan Bouchet-Valat <nalimilan@club.fr>
…werLink and updated test cases
|
Good to merge? |
|
Bump again. @nalimilan Is this good to merge? |
The suggestion is committed. Co-authored-by: Milan Bouchet-Valat <nalimilan@club.fr>
|
Thanks! |
PowerLink refers to the class of transforms that use a power function (e.g. a logarithm or an exponent) to transform responses into a Gaussian or a Gaussian-like.
The summaries of the changes in the following source files are:
linkto GlmResp structure. This is for storing details of the link function with parameters (if any)linkfunfunction for PowerLinklinkinv functionfor PowerLinkmuetafunction for PowerLinkinverselinkfunction for PowerLinkglm()