Skip to content

Commit

Permalink
0.8.5 release
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewReid854 committed May 25, 2022
1 parent 9a55b82 commit a21fbbb
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
11 changes: 11 additions & 0 deletions docs/Changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@
Changelog
---------

**Version: 0.8.5 --- Released: 25 May 2022**
''''''''''''''''''''''''''''''''''''''''''''

**Summary of changes**

This is bugfix release to deal with a minor bug.

**Bug Fixes**

- The equation for the Loglogistic Hazard function was wrong. It mistakenly used the equation for the Weibull Hazard Function. Fitted results are unaffected. This bug only affected the plot and numerical outputs of the Loglogistic Hazard Function. Thanks to Kaiya Raby for finding and reporting this bug.

**Version: 0.8.4 --- Released: 05 May 2022**
''''''''''''''''''''''''''''''''''''''''''''

Expand Down
2 changes: 1 addition & 1 deletion docs/Mixture models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ See also `competing risk models <https://reliability.readthedocs.io/en/latest/Co
Creating a mixture model
========================

Within `reliability.Distributions` is the Mixture_Model. This function accepts an array or list of standard distribution objects created using the `reliability.Distributions` module (available distributions are Exponential, Weibull, Gumbel, Normal, Lognormal, Loglogistic, Gamma, Beta). There is no limit to the number of components you can add to the mixture, but is is generally preferable to use as few as are required to fit the data appropriately (typically 2 or 3). In addition to the distributions, you can specify the proportions contributed by each distribution in the mixture. These proportions must sum to 1. If not specified the proportions will be set as equal for each component.
Within `reliability.Distributions` is the Mixture_Model. This function accepts an array or list of standard distribution objects created using the `reliability.Distributions` module (available distributions are Exponential, Weibull, Gumbel, Normal, Lognormal, Loglogistic, Gamma, Beta). There is no limit to the number of components you can add to the mixture, but it is generally preferable to use as few as are required to fit the data appropriately (typically 2 or 3). In addition to the distributions, you can specify the proportions contributed by each distribution in the mixture. These proportions must sum to 1. If not specified the proportions will be set as equal for each component.

As this process is additive for the survival function, and may accept many distributions of different types, the mathematical formulation quickly gets complex. For this reason, the algorithm combines the models numerically rather than empirically so there are no simple formulas for many of the descriptive statistics (mean, median, etc.). Also, the accuracy of the model is dependent on xvals. If the xvals array is small (<100 values) then the answer will be "blocky" and inaccurate. The variable xvals is only accepted for PDF, CDF, SF, HF, and CHF. The other methods (like random samples) use the default xvals for maximum accuracy. The default number of values generated when xvals is not given is 1000. Consider this carefully when specifying xvals in order to avoid inaccuracies in the results.

Expand Down
7 changes: 4 additions & 3 deletions reliability/Distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6149,9 +6149,10 @@ def HF(self, xvals=None, xmin=None, xmax=None, show_plot=True, **kwargs):
self, "HF", xvals, xmin, xmax, show_plot
) # lgtm [py/mismatched-multiple-assignment]

hf = (self.beta / self.alpha) * ((X - self.gamma) / self.alpha) ** (
self.beta - 1
)
hf = (
(self.beta / self.alpha)
* ((X - self.gamma) / self.alpha) ** (self.beta - 1)
) / (1 + ((X - self.gamma) / self.alpha) ** self.beta)
hf = zeroise_below_gamma(X=X, Y=hf, gamma=self.gamma)
hf = unpack_single_arrays(hf)

Expand Down
2 changes: 1 addition & 1 deletion reliability/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from datetime import date

__title__ = 'reliability'
__version__ = "0.8.4"
__version__ = "0.8.5"
__description__ = 'A Python library for reliability engineering'
__url__ = 'https://reliability.readthedocs.io/en/latest/index.html'
__author__ = 'Matthew Reid'
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setuptools.setup(
name="reliability",
version="0.8.4",
version="0.8.5",
description="Reliability Engineering toolkit for Python",
author="Matthew Reid",
author_email="alpha.reliability@gmail.com",
Expand Down

0 comments on commit a21fbbb

Please sign in to comment.