Skip to content

Commit

Permalink
multiple updates for 0.7.0 see changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewReid854 committed Sep 8, 2021
1 parent 7e86284 commit 74ff19e
Show file tree
Hide file tree
Showing 22 changed files with 1,275 additions and 416 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Detailed documentation and examples are available at [readthedocs](https://relia
## Key features
- Fitting probability distributions to data including right censored data
- Fitting Weibull mixture models and Weibull Competing risks models
- Fitting Weibull Defective Subpopulation (DS), Weibull Zero Inflated (ZI) models, and Weibull Defective Subpopulation Zero Inflated (DSZI) models
- Fitting Weibull Defective Subpopulation (DS) models, Weibull Zero Inflated (ZI) models, and Weibull Defective Subpopulation Zero Inflated (DSZI) models
- Calculating the probability of failure for stress-strength interference between any combination of the supported distributions
- Support for Exponential, Weibull, Gamma, Gumbel, Normal, Lognormal, Loglogistic, and Beta probability distributions
- Mean residual life, quantiles, descriptive statistics summaries, random sampling from distributions
Expand Down
28 changes: 28 additions & 0 deletions docs/Changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,34 @@
Changelog
---------

**Version: 0.7.0 --- Currently unreleased --- scheduled for release by end of Sept 2021**
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

**Summary of changes**

- This will be provided closer to the final release.

**New features**

- Downsampling for the scatter plot on probability plots. This makes plotting much faster for large datasets (>1000 failures), particularly when using Fit_Everything which has many subplots.
- Added Weibull_Mixture, Weibull_CR, and Weibull_DS to Fit Everything. This also required changes to the plot window sizes.
- Changed the histogram plot from Fit_Everything. Legend is now on the left as it was getting too long with 15 items. New method used to scale the CDF histogram when there is censored data which is more accurate than the previous scaling method.

**API Changes**

- The keyword "downsample_scatterplot" now appears in all fitters and probability plots. It controls whether the scatterplot will apply downsampling. This only affects the plot (when there are over 1000 data points) not the calculations.

**Bug Fixes**

- Resolved Deprecation Warning from numpy in PoF.strain_life_diagram.
- Fit_Everything had a bug when the best distribution was Weibull_Mixture, Weibull_CR, Weibull_DS due to these distributions not having param_title_long.
- Probability plots with very large datasets (>10000 items) sometimes resulted in the upper ylim being 1. This is equivalent to infinity on a probability plot and caused an error. It is now manually corrected for.
- The least squares method for Fit_Gamma_3P produced a very poor estimate due to a bug. This carried across into the MLE result since LS is used for the MLE initial guess.

**Other**

- Changed the method used by curve_fit within least_squares. Previously was 'dogleg' which was very slow. Changed to 'trf'. This significantly speeds up the location shifted distributions (Weibull_3P, etc.)

**Version: 0.6.0 --- Released: 23 July 2021**
'''''''''''''''''''''''''''''''''''''''''''''

Expand Down
5 changes: 3 additions & 2 deletions docs/Citing reliability in your work.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ If `reliability` contributes to a project that leads to a scientific publication

The following reference is using APA:

**Reid, M. (2021). Reliability – a Python library for reliability engineering (Version 0.5.7) [Computer software]. Zenodo. https://doi.org/10.5281/ZENODO.3938000**
**Reid, M. (2021). Reliability – a Python library for reliability engineering (Version 0.6.0) [Computer software]. Zenodo. https://doi.org/10.5281/ZENODO.3938000**

If you would like to use another referencing style, the details you may need are:

- **Author:** Matthew Reid
- **Year published:** 2021
- **Title:** Reliability – a Python library for reliability engineering
- **Version:** 0.5.7
- **Version:** 0.6.0
- **Platform:** Python
- **Available from:** https://pypi.org/project/reliability/
- **DOI:** 10.5281/zenodo.3938000
Expand All @@ -27,6 +27,7 @@ If you have used ``reliability`` in any published academic work, I would love to

**Links to articles and papers that have used the Python reliability library:**

- `Reliability Engineering Using Python <https://accendoreliability.com/reliability-engineering-using-python/>`_ - by Matthew Reid.
- `Probabilistic characterization of random variables - Phase II <https://medium.com/@javier8amoreno/caracterizaci%C3%B3n-probabilista-de-variables-aleatorias-fase-ii-215793df2cc>`_ - by Javier Alfonso Ochoa Moreno. Note that this article is in Spanish.
- `A tutorial for reliability engineers: going from scratch to building Weibull Analyses using Python <https://www.linkedin.com/pulse/tutorial-reliability-engineers-going-from-scratch-sarah/>`_ - by Dr Sarah Lukens.
- `Predictive Modeling of a repairable system using Data Analytics Tool <https://medium.com/geekculture/predictive-modelling-b18bb7bf85db>`_ - by Chiranjit Pathak.
2 changes: 1 addition & 1 deletion docs/DSZI models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ The plot below shows the CDF on the Weibull probability plot (left) and on linea
failures, right_censored = model.random_samples(100,seed=5,right_censored_time=3000)
plt.subplot(121)
fit = Fit_Weibull_DSZI(failures=failures,right_censored=right_censored,show_probability_plot=True,label='fitted Weibull_DSZI')
fit = Fit_Weibull_DSZI(failures=failures,right_censored=right_censored,label='fitted Weibull_DSZI')
model.CDF(label='true model')
plt.legend()
Expand Down
2 changes: 1 addition & 1 deletion docs/Development roadmap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This roadmap is regularly changing and you may see some things remain on here fo
If you have a suggested feature or you find a bug, please raise an `Issue <https://github.com/MatthewReid854/reliability/issues>`_ on Github or email me (alpha.reliability@gmail.com) and I will endeavour to either add it rapidly (for simple tasks and bug fixes) or add it to the roadmap.
The current release schedule is approximately every 6 to 8 weeks.

**Planned for version 0.7.0 (around October 2021)**
**Planned for version 0.8.0 (around Oct/Nov 2021)**

- Correct the formatting in the API docs for every function - still need to do ALT_Fitters, Convert_data, Datasets, PoF, and Utils
- Within all fitters, use the FNRN format to give speed improvements in the same way as Fit_Weibull_2P_grouped works internally. This will subsequently result in the deprecation of Fit_Weibull_2P_grouped once its advantage is integrated in Fit_Weibull_2P. Need to confirm this method does not introduce too much cumulative error due to floating point precision limitations.
Expand Down
36 changes: 18 additions & 18 deletions docs/Fitting a specific distribution to data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ It is beneficial to see the effectiveness of the fitted distribution in comparis
'''
There are 118 right censored items.
Fit_Weibull_3P parameters:
Alpha: 28.87474387333969
Beta: 2.0294949463087324
Gamma 20.383959526415147
Alpha: 28.874745169627886
Beta: 2.0294944619390654
Gamma 20.383959629725744
'''
.. image:: images/Fit_Weibull_3P_right_cens_V5.png
Expand Down Expand Up @@ -184,20 +184,20 @@ As another example, we will fit a Gamma_2P distribution to some partially right
'''
Fit_Gamma_2P parameters using 10 samples:
Alpha: 19.424319786626086
Beta: 4.69047083028225
Alpha: 19.42603577754394
Beta: 4.6901283424759255
Fit_Gamma_2P parameters using 100 samples:
Alpha: 36.26414346544092
Beta: 3.2929424158773286
Alpha: 36.26411284656554
Beta: 3.2929448936077534
Fit_Gamma_2P parameters using 1000 samples:
Alpha: 28.825239132661917
Beta: 4.0629289662058365
Alpha: 28.825423280158407
Beta: 4.062909060146121
Fit_Gamma_2P parameters using 10000 samples:
Alpha: 30.30128521400655
Beta: 3.9600849740612447
Alpha: 30.301232862075587
Beta: 3.96009153189253
'''
.. image:: images/Fit_Gamma_2P_right_cens_V5.png
Expand Down Expand Up @@ -342,12 +342,12 @@ The following example shows how we can use Fit_Weibull_2P_grouped to fit a Weibu
Failures / Right censored: 10/4072 (99.75502% right censored)
Parameter Point Estimate Standard Error Lower CI Upper CI
Alpha 3.32225e+21 3.18953e+22 2.23595e+13 4.93629e+29
Beta 0.156165 0.0387594 0.0960103 0.254008
Alpha 6.19454e+21 7.7592e+22 1.34889e+11 2.84473e+32
Beta 0.153742 0.0485886 0.0827523 0.285632
Goodness of fit Value
Log-likelihood -144.618
AICc 293.239
BIC 305.865
AD 264.999
Log-likelihood -144.617
AICc 293.236
BIC 305.862
AD 264.999
'''

0 comments on commit 74ff19e

Please sign in to comment.