-
Notifications
You must be signed in to change notification settings - Fork 56
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
Add Generalised Linear Models to FSharpStats #334
Merged
Merged
Changes from all commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
6288d55
Implement IRLS solver for GLMs
LibraChris 425d12b
Rename variables
LibraChris d1c9c41
add qr based GLM
LibraChris d637be7
add inital tests for the glm
LibraChris d0fc5ee
Update glm QR Solver
LibraChris d24955a
Add new Test for GLMs using Gamma Distribution
LibraChris ddcf09c
Add tests for the Poisson linker functions
LibraChris 60c3ec1
Add tests for the Gamma linker functions
LibraChris 0f0661c
Rename testcases to Reflect their log function
LibraChris fe83ba6
Add tests for the LogitLinkFunction
LibraChris ab44068
Add tests for the InverseSquaredLinkFunction
LibraChris c00980e
Add tests by example for glm IrLS solver
LibraChris 1e6a524
Add tests for the IdentityLinkFunction
LibraChris ac416bf
Add tests groudwork for the BinomialLinkFunction
LibraChris 8f88c1e
Add tests for the variance of Binominal Family
LibraChris 148a933
Add tests for the variance of Poisson Family
LibraChris a8b5f00
Add tests for the variance of Gaussian/Normal Family
LibraChris 2cbef3c
Fix test implemetation for familyVarianceFunctions
LibraChris a73a07e
Add tests for the variance of Gamma Family
LibraChris 4d03d46
Add tests for the variance of Inv.Gaussian Family
LibraChris 4465115
Rename test Cases based on their DistributionFamily
LibraChris a6e6568
Fix LogitLinkFunction
LibraChris de1fcd7
remove redundant BinomialLinkFunction
LibraChris 3554a02
Remove redundant LinkFunction
LibraChris c1f38f1
Fix InverseSquaredLinkFunction
LibraChris 2a3b096
Updated Gamma Distribution Variance function
LibraChris 3f5a349
add Deriv Functions
LibraChris 2787fbd
add Tests for Link and deriv
LibraChris 3ee33e3
fix various Linkfunctions
LibraChris 43cea23
Rework GLM QR Solver
LibraChris 3e83833
Modify tests
LibraChris 2816155
Add tests prototype for QR-Stepwise iteration
LibraChris c5ced84
Fix QR based solver for GLMs
LibraChris 5029c3a
Modify Variance tests
LibraChris c3dddcb
Update statistics
LibraChris a7c5c1b
Update GeneralisedLinearModel.fs
LibraChris d8877b7
Update GeneralisedLinearModel.fs
LibraChris 3cd68a8
Update GeneralisedLinearModel.fs
LibraChris 253ac91
Rework GLMStatistics
LibraChris 19cad0f
Remove deprecated GLM.Irls
LibraChris 1b3336f
Fix minor testing issue
LibraChris a1d0ee4
add getFamilyReisualDeviance for more families
LibraChris 37d03e0
Write code comments and documentation
LibraChris 5e9a1b6
add Documentation for GLM Usage
LibraChris 72bfb83
Update formating for documentation
LibraChris a8a0004
added data for Documentation
LibraChris f694340
remote tests for binominal family variance
LibraChris 8dcd8ab
Adress changes requested in #344
LibraChris 170519e
Adress changes requested in #334
LibraChris ba5ae9c
Update xml comments
LibraChris 6c3a235
fix building error
LibraChris 2e80081
Fix Typo
LibraChris 13b3de9
Fix indentations
LibraChris df24c3f
Updated XML documentation
LibraChris File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
"","Taste","Acetic","H2S","Lactic" | ||
"1",12.3,94,23,0.86 | ||
"2",20.9,174,155,1.53 | ||
"3",39,214,230,1.57 | ||
"4",47.9,317,1801,1.81 | ||
"5",5.6,106,45,0.99 | ||
"6",25.9,298,2000,1.09 | ||
"7",37.3,362,6161,1.29 | ||
"8",21.9,436,2881,1.78 | ||
"9",18.1,134,47,1.29 | ||
"10",21,189,65,1.58 | ||
"11",34.9,311,465,1.68 | ||
"12",57.2,630,2719,1.9 | ||
"13",0.7,88,20,1.06 | ||
"14",25.9,188,140,1.3 | ||
"15",54.9,469,856,1.52 | ||
"16",40.9,581,14589,1.74 | ||
"17",15.9,120,50,1.16 | ||
"18",6.4,224,110,1.49 | ||
"19",18,190,480,1.63 | ||
"20",38.9,230,8639,1.99 | ||
"21",14,96,141,1.15 | ||
"22",15.2,200,185,1.33 | ||
"23",32,234,10322,1.44 | ||
"24",56.7,349,26876,2.01 | ||
"25",16.8,214,39,1.31 | ||
"26",11.6,421,25,1.46 | ||
"27",26.5,638,1056,1.72 | ||
"28",0.7,206,50,1.25 | ||
"29",13.4,331,800,1.08 | ||
"30",5.5,481,120,1.25 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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'm not sure if I get whats happening here:
i
in line 262i
which always should be 0, because it was initialized with 0. Just after the determination of qLength the value at this specific index is replaced in line 262.Obviously I miss a step, but is there a possibility to create the qLength by Vector.init (...) rather than keeping it mutable and accessing/mutating it at multiple positions? If not, I'm happy to merge it, but I got confused during my attempt to understand whats happening here..
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.
Could you additionally set into -brackets a reference to this implementation and a short description what the benefit, drawback is when using this implementation over others.
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 do not have a direct reference since I had a look at the mathematical explanation for QR via Gram Schmidt and tried implementing it myself. The only real upside using this method instead of the in FSharp.Stats established one is the difference in the output Dimensions in R. An actual reference would be the numpy implantation of the reduced qr https://numpy.org/doc/stable/reference/generated/numpy.linalg.qr.html .
I also think that this implemtation needs to be optimised in the future to perfect the GLM.
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.
The mutation was done to simplify the function to match the mathematical explanation better. This is one of the things that could be updated when I get to it.