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

Llprior #56

Merged
merged 8 commits into from Jan 2, 2017
Merged

Llprior #56

merged 8 commits into from Jan 2, 2017

Conversation

jake-westfall
Copy link
Collaborator

This changes the implementation of the default priors so that they are based entirely on the log-likelihood function, never referencing the multiple regressions of Y and X on the covariates as in the previous implementation. For Normal response models, the results are essentially the same as before, but not exactly, as the new implementation relies on a quadratic approximation to the log-likelihood function (which is close but not perfect). Non-normal response models are now handled exactly the same as Normal response models now. However, the quadratic approximation to the log-likelihood is not as good for non-Normal response models, so the interpretation of the priors in terms of the standard deviation of the implied partial correlation should be considered a fairly rough approximation. Nevertheless, the default priors for non-Normal models are now much more intuitively sensible than before. This same implementation should also work almost entirely "as-is" for other link functions / response distributions that we have not explicitly implemented; all we really need to do is point to the appropriate statsmodels distribution family in priors.py.

We might be able to upgrade the quadratic approximation to a quartic approximation, which should give even better results. But I have not worked this out yet. In any case, for now this is ready for production.

jake-westfall added 8 commits November 7, 2016 11:42
Seems to work in ideal cases, but does not pass tests yet. In particular,
need to modify the na-checking code. Will do in future commit.
Previously when dropna=True user was warned that NAs would be dropped, but
they never actually got dropped. This also fixes the LL prior implementation
for slope-only models.
Also removes the calls to pd.stats.ols that were giving unsightly
warnings during model building.
We now numerically approximate the 2nd derivative manually rather than
using GLM.hessian() from statsmodels.
@coveralls
Copy link

coveralls commented Jan 2, 2017

Coverage Status

Coverage increased (+0.1%) to 96.839% when pulling 93a369c on llprior into 038984b on master.

@tyarkoni tyarkoni merged commit ddc19c8 into master Jan 2, 2017
@jake-westfall jake-westfall deleted the llprior branch January 3, 2017 00:31
jake-westfall pushed a commit that referenced this pull request Sep 29, 2017
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

Successfully merging this pull request may close these issues.

None yet

3 participants