Skip to content

Commit

Permalink
work through the parameterization
Browse files Browse the repository at this point in the history
  • Loading branch information
wd60622 committed Sep 27, 2024
1 parent f9a5197 commit dc30484
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions conjugate/distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1192,6 +1192,8 @@ def dist(self):
class Weibull(ContinuousPlotDistMixin, SliceMixin):
"""Weibull distribution.
Parameterization from Section 2.11 of <a href="https://web.archive.org/web/20090529203101/http://www.people.cornell.edu/pages/df36/CONJINTRnew%20TEX.pdf">paper</a>.
Args:
beta: shape parameter
theta: scale parameter
Expand All @@ -1201,10 +1203,17 @@ class Weibull(ContinuousPlotDistMixin, SliceMixin):
```python
import matplotlib.pyplot as plt
import numpy as np
from conjugate.distributions import Weibull
distribution = Weibull(beta=1, theta=[0.5, 1.0, 1.5, 5.0])
lam = 1
k = np.array([0.5, 1.0, 1.5, 5.0])
beta = k
theta = lam ** beta
distribution = Weibull(beta=beta, theta=theta)
ax = distribution.set_bounds(0, 2.5).plot_pdf(
label=["k=0.5", "k=1.0", "k=1.5", "k=5.0"],
color=["blue", "red", "pink", "green"],
Expand All @@ -1223,4 +1232,6 @@ class Weibull(ContinuousPlotDistMixin, SliceMixin):

@property
def dist(self):
return stats.weibull_min(c=self.theta, scale=self.beta)
k = self.beta
lam = self.theta ** (1 / self.beta)
return stats.weibull_min(c=k, scale=lam)

Check warning on line 1237 in conjugate/distributions.py

View check run for this annotation

Codecov / codecov/patch

conjugate/distributions.py#L1235-L1237

Added lines #L1235 - L1237 were not covered by tests

0 comments on commit dc30484

Please sign in to comment.