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
ENH: Add bayes glm model #9235
base: main
Are you sure you want to change the base?
ENH: Add bayes glm model #9235
Conversation
Added rpy2 and working data
add examples from arm documentation add translation notes
Implements through to M8 from the docs
scope tests to unit test only. e2e tests are moved to example notebook
tests files for e2e moved to example notebook
Hello @cearlefraym! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2024-04-27 15:40:48 UTC |
Note, GPL is not license compatible with our BSD-3 license. Also, statsmodels is mainly focused on frequentist model, with some Bayesian approaches where it provides additional advantages. |
NumPy's guide.
The Bayes Generalized Linear Model (BGLM) is available in R through the
arm
package and was released with the corresponding paper titled A Weakly Informative Default Prior Distribution for Logistic and other Regression Models. BGLM is a Generalized Linear Model (GLM) that accepts prior mean, prior standard deviation, and prior degrees of freedom for the coefficients, and fits a model with additional pseudo-data points.I was unable to find a Python package that implements the same BGLM algorithm as is found in the
arm
package.statsmodels
does, however, contain a GLM model which was built to provide the sameglm
functionality in Python as is available in R. Since thebayesglm
is built off theglm
I used this as a starting point to translate thebayesglm
process to Python.Detailed translation notes can be found in the example notebook
bayesglm.ipynb
Notes:
needed for doc changes.
then show that it is fixed with the new code.
verify you changes are well formatted by running
flake8
is installed. This command is also available on Windowsusing the Windows System for Linux once
flake8
is installed in thelocal Linux environment. While passing this test is not required, it is good practice and it help
improve code quality in
statsmodels
.