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

Make new example for Unsupported Distribution #125

Closed
wd60622 opened this issue Sep 28, 2024 · 0 comments · Fixed by #145
Closed

Make new example for Unsupported Distribution #125

wd60622 opened this issue Sep 28, 2024 · 0 comments · Fixed by #145
Labels
docs Improvements or additions to documentation

Comments

@wd60622
Copy link
Owner

wd60622 commented Sep 28, 2024

After #123, the unsupported_distribution example doesn't make sense and was removed.
There should be a new example to show this off.

The pareto distribution might be a good candidate for this

import numpy as np

from conjugate.distributions import Gamma, Pareto
from conjugate.models import pareto_gamma

prior = Gamma(1, 1)
data = [1, 2, 1, 2, 3]

posterior = pareto_gamma(n=len(data), ln_x_total=np.log(data).sum(), prior=prior, x_m=1)


posterior_samples = posterior.dist.rvs(size=1000)
posterior_predictive_samples = Pareto(x_m=1, alpha=posterior_samples).rvs(size=1000)
@wd60622 wd60622 added the docs Improvements or additions to documentation label Sep 28, 2024
@wd60622 wd60622 linked a pull request Sep 30, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant