Skip to content

Commit

Permalink
updating docs
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewReid854 committed Oct 7, 2021
1 parent 5b4c4a2 commit b7325fc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 152 deletions.
13 changes: 5 additions & 8 deletions docs/Changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@
Changelog
---------

**Version: 0.7.0 --- Currently unreleased --- scheduled for release by early October 2021**
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
**Version: 0.7.0 --- Released: 8 Oct 2021**
'''''''''''''''''''''''''''''''''''''''''''

**Summary of changes**

- Version 0.7.0 has a few really useful enhancements. The first of these is the addition of three of the special models (mixture, competing risks, defective subpopulation) to the Fit_Everything function.
The second major enhancement is faster plotting for large datasets using downsampling.
There are also numerous bug fixes that resolve several longstanding minor issues as well as some minor changes that make some of the algorithms more reliable.
Version 0.7.0 has a few really useful enhancements. The first of these is the addition of three of the special models (mixture, competing risks, defective subpopulation) to the Fit_Everything function. The second major enhancement is faster plotting for large datasets using downsampling. There are also numerous bug fixes that resolve several longstanding minor issues as well as some minor changes that make some of the algorithms more reliable.

**New features**

Expand All @@ -38,15 +36,14 @@ Changelog

- 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.)
- Changed the group splitting algorithm used in Fit_Weibull_Mixture and Fit_Weibull_CR. The new method is more robust and provides better a better initial guess of the parameters for MLE.
- Completed the reformatting of the API docs for all the ALT_Fitters. Still need to do this for the Convert_data, Datasets, PoF, Utils modules. Reformatted API docs for these remaining modules will be part of a future release.

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

**Summary of changes**

- Version 0.6.0 has two main improvements. Firstly the behaviour of the optimizers has been changed to be more efficient, and to allow users to try multiple optimizers easily by specifying optimizer='best'.
Secondly, the addition of the Defective Subpopulation (DS) and Zero Inflated (ZI) Model now provides a model for which the CDF can range from above 0 to below 1.
There are several new Fitters added to take advantage of this as detailed below.
Version 0.6.0 has two main improvements. Firstly the behaviour of the optimizers has been changed to be more efficient, and to allow users to try multiple optimizers easily by specifying optimizer='best'. Secondly, the addition of the Defective Subpopulation (DS) and Zero Inflated (ZI) Model now provides a model for which the CDF can range from above 0 to below 1. There are several new Fitters added to take advantage of this as detailed below.

**New features**

Expand Down
50 changes: 3 additions & 47 deletions docs/Fitting a dual stress model to ALT data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,53 +24,9 @@ The following dual stress models are available within ALT_fitters:
- Fit_Exponential_Power_Exponential
- Fit_Exponential_Dual_Power

Each of the ALT models works in a very similar way so the documentation below can be applied to all of the dual stress models with minor modifications to the parameter names of the outputs. The following documentation is for the Weibull_Dual_Exponential model.

Inputs:

- failures - an array or list of the failure times.
- failure_stress_1 - an array or list of the corresponding stress 1 (such as temperature) at which each failure occurred. This must match the length of failures as each failure is tied to a failure stress.
- failure_stress_2 - an array or list of the corresponding stress 2 (such as humidity) at which each failure occurred. This must match the length of failures as each failure is tied to a failure stress.
- right_censored - an array or list of all the right censored failure times
- right_censored_stress_1 - an array or list of the corresponding stress 1 (such as temperature) at which each right_censored data point was obtained. This must match the length of right_censored as each right_censored value is tied to a right_censored stress.
- right_censored_stress_2 - an array or list of the corresponding stress 1 (such as humidity) at which each right_censored data point was obtained. This must match the length of right_censored as each right_censored value is tied to a right_censored stress.
- use_level_stress - [stress_1, stress_2]. A two element list or array of the use level stresses at which you want to know the mean life. Optional input.
- print_results - True/False. Default is True
- show_probability_plot - True/False/axes. Default is True. If an axes object is passed it will be used.
- show_life_stress_plot - True/False/axes. Default is True. If an axes object is passed it will be used.
- CI - confidence interval for estimating confidence limits on parameters. Must be between 0 and 1. Default is 0.95 for 95% CI.
- optimizer - 'TNC', 'L-BFGS-B', 'powell'. Default is 'TNC'. These are all bound constrained methods. If the bound constrained method fails, nelder-mead will be used. If nelder-mead fails the initial guess (using least squares) will be returned with a warning.

Outputs:

- a - fitted parameter from the Dual_Exponential model
- b - fitted parameter from the Dual_Exponential model
- c - fitted parameter from the Dual_Exponential model
- beta - the fitted Weibull_2P beta
- loglik2 - Log Likelihood*-2 (as used in JMP Pro)
- loglik - Log Likelihood (as used in Minitab and Reliasoft)
- AICc - Akaike Information Criterion
- BIC - Bayesian Information Criterion
- a_SE - the standard error (sqrt(variance)) of the parameter
- b_SE - the standard error (sqrt(variance)) of the parameter
- c_SE - the standard error (sqrt(variance)) of the parameter
- beta_SE - the standard error (sqrt(variance)) of the parameter
- a_upper - the upper CI estimate of the parameter
- a_lower - the lower CI estimate of the parameter
- b_upper - the upper CI estimate of the parameter
- b_lower - the lower CI estimate of the parameter
- c_upper - the upper CI estimate of the parameter
- c_lower - the lower CI estimate of the parameter
- beta_upper - the upper CI estimate of the parameter
- beta_lower - the lower CI estimate of the parameter
- results - a dataframe of the results (point estimate, standard error, Lower CI and Upper CI for each parameter)
- goodness_of_fit - a dataframe of the goodness of fit criterion (Log-likelihood, AICc, BIC)
- change_of_parameters - a dataframe showing the change of the parameters (alpha and beta) at each stress level
- mean_life - the mean life at the use_level_stress (only provided if use_level_stress is provided)
- alpha_at_use_stress - the equivalent Weibull alpha parameter at the use level stress (only provided if use_level_stress is provided)
- distribution_at_use_stress - the Weibull distribution at the use level stress (only provided if use_level_stress is provided)
- probability_plot - the axes handles for the figure object from the probability plot (only provided if show_probability_plot is True)
- life_stress_plot - the axes handles for the figure object from the life-stress plot (only provided if show_life_stress_plot is True)
.. admonition:: API Reference

For inputs and outputs see the `API reference <https://reliability.readthedocs.io/en/latest/API/ALT_fitters.html>`_.

Example 1
---------
Expand Down
44 changes: 3 additions & 41 deletions docs/Fitting a single stress model to ALT data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,47 +24,9 @@ The following single stress models are available within ALT_fitters:
- Fit_Exponential_Eyring
- Fit_Exponential_Power

Each of the ALT models works in a very similar way so the documentation below can be applied to all of the single stress models with minor modifications to the parameter names of the outputs. The following documentation is for the Weibull-Power model.

Inputs:

- failures - an array or list of the failure times.
- failure_stress - an array or list of the corresponding stresses (such as load) at which each failure occurred. This must match the length of failures as each failure is tied to a failure stress.
- right_censored - an array or list of all the right censored failure times.
- right_censored_stress - an array or list of the corresponding stresses (such as load) at which each right_censored data point was obtained. This must match the length of right_censored as each right_censored value is tied to a right_censored stress.
- use_level_stress - The use level stress at which you want to know the mean life. Optional input.
- print_results - True/False. Default is True
- show_probability_plot - True/False/axes. Default is True. If an axes object is passed it will be used.
- show_life_stress_plot - True/False/axes. Default is True. If an axes object is passed it will be used.
- CI - confidence interval for estimating confidence limits on parameters. Must be between 0 and 1. Default is 0.95 for 95% CI.
- optimizer - 'TNC', 'L-BFGS-B', 'powell'. Default is 'TNC'. These are all bound constrained methods. If the bound constrained method fails, nelder-mead will be used. If nelder-mead fails the initial guess (using least squares) will be returned with a warning.

Outputs:

- a - fitted parameter from the Power model
- n - fitted parameter from the Power model
- beta - the fitted Weibull_2P beta
- loglik2 - Log Likelihood*-2 (as used in JMP Pro)
- loglik - Log Likelihood (as used in Minitab and Reliasoft)
- AICc - Akaike Information Criterion
- BIC - Bayesian Information Criterion
- a_SE - the standard error (sqrt(variance)) of the parameter
- n_SE - the standard error (sqrt(variance)) of the parameter
- beta_SE - the standard error (sqrt(variance)) of the parameter
- a_upper - the upper CI estimate of the parameter
- a_lower - the lower CI estimate of the parameter
- n_upper - the upper CI estimate of the parameter
- n_lower - the lower CI estimate of the parameter
- beta_upper - the upper CI estimate of the parameter
- beta_lower - the lower CI estimate of the parameter
- results - a dataframe of the results (point estimate, standard error, Lower CI and Upper CI for each parameter)
- goodness_of_fit - a dataframe of the goodness of fit criterion (Log-likelihood, AICc, BIC)
- change_of_parameters - a dataframe showing the change of the parameters (alpha and beta) at each stress level
- mean_life - the mean life at the use_level_stress (only provided if use_level_stress is provided)
- alpha_at_use_stress - the equivalent Weibull alpha parameter at the use level stress (only provided if use_level_stress is provided)
- distribution_at_use_stress - the Weibull distribution at the use level stress (only provided if use_level_stress is provided)
- probability_plot - the axes handles for the figure object from the probability plot (only provided if show_probability_plot is True)
- life_stress_plot - the axes handles for the figure object from the life-stress plot (only provided if show_life_stress_plot is True)
.. admonition:: API Reference

For inputs and outputs see the `API reference <https://reliability.readthedocs.io/en/latest/API/ALT_fitters.html>`_.

Example 1
---------
Expand Down
59 changes: 3 additions & 56 deletions docs/Fitting all available models to ALT data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,62 +9,9 @@ Just as the function `Fitters.Fit_Everything` provides users with a quick way to

There are 24 ALT models available within `reliability`; 12 single stress models and 12 dual stress models. `Fit_Everything_ALT` will automatically fit the single stress or dual stress models based on whether the input includes single or dual stress data. Manual exclusion of certain models is also possible using the `exclude` argument. From the results, the models are sorted based on their goodness of fit test results, where the smaller the goodness of fit value, the better the fit of the model to the data.

Inputs:

- failures - an array or list of the failure times (this does not need to be sorted).
- failure_stress_1 - an array or list of the corresponding stresses (such as temperature or voltage) at which each failure occurred. This must match the length of failures as each failure is tied to a failure stress.
- failure_stress_2 - an array or list of the corresponding stresses (such as temperature or voltage) at which each failure occurred. This must match the length of failures as each failure is tied to a failure stress. Optional input. Providing this will trigger the use of dual stress models. Leaving this empty will trigger the use of single stress models.
- right_censored - an array or list of the right failure times (this does not need to be sorted). Optional Input.
- right_censored_stress_1 - an array or list of the corresponding stresses (such as temperature or voltage) at which each right_censored data point was obtained. This must match the length of right_censored as each right_censored value is tied to a right_censored stress.
- right_censored_stress_2 - an array or list of the corresponding stresses (such as temperature or voltage) at which each right_censored data point was obtained. This must match the length of right_censored as each right_censored value is tied to a right_censored stress. Conditionally optional input. This must be provided if failure_stress_2 is provided.
- use_level_stress - The use level stress at which you want to know the mean life. Optional input. This must be a list [stress_1,stress_2] if failure_stress_2 is provided.
- print_results - True/False. Default is True
- show_probability_plot - True/False. Default is True. Provides a probability plot of each of the fitted ALT model.
- show_best_distribution_probability_plot - True/False. Defaults to True. Provides a probability plot in a new figure of the best ALT model.
- CI - confidence interval for estimating confidence limits on parameters. Must be between 0 and 1. Default is 0.95 for 95% CI.
- optimizer - 'TNC', 'L-BFGS-B', 'powell'. Default is 'TNC'. These are all bound constrained methods. If the bound constrained method fails, nelder-mead will be used. If nelder-mead fails the initial guess (using least squares) will be returned with a warning.
- sort_by - goodness of fit test to sort results by. Must be 'BIC','AICc', or 'Log-likelihood'. Default is BIC.
- exclude - list or array of strings specifying which distributions to exclude. Default is None. Options are:

- Weibull_Exponential
- Weibull_Eyring
- Weibull_Power
- Weibull_Dual_Exponential
- Weibull_Power_Exponential
- Weibull_Dual_Power
- Lognormal_Exponential
- Lognormal_Eyring
- Lognormal_Power
- Lognormal_Dual_Exponential
- Lognormal_Power_Exponential
- Lognormal_Dual_Power
- Normal_Exponential
- Normal_Eyring
- Normal_Power
- Normal_Dual_Exponential
- Normal_Power_Exponential
- Normal_Dual_Power
- Exponential_Exponential
- Exponential_Eyring
- Exponential_Power
- Exponential_Dual_Exponential
- Exponential_Power_Exponential
- Exponential_Dual_Power

Outputs:

- results - the dataframe of results. Fitted parameters in this dataframe may be accessed by name. See below example.
- best_model_name - the name of the best fitting ALT model. E.g. 'Weibull_Exponential'. See above list for exclude.
- best_model_at_use_stress - a distribution object created based on the parameters of the best fitting ALT model at the use stress. This is only provided if the use_level_stress is provided. This is because use_level_stress is required to find the scale parameter.
- excluded_models - a list of the models which were excluded. This will always include at least half the models since only single stress OR dual stress can be fitted depending on the data.
- parameters and goodness of fit results for each fitted model. For example, the Weibull_Exponential model values are:

- Weibull_Exponential_a
- Weibull_Exponential_b
- Weibull_Exponential_beta
- Weibull_Exponential_BIC
- Weibull_Exponential_AICc
- Weibull_Exponential_loglik
.. admonition:: API Reference

For inputs and outputs see the `API reference <https://reliability.readthedocs.io/en/latest/API/Fit_Everything_ALT.html>`_.

Example 1
---------
Expand Down

0 comments on commit b7325fc

Please sign in to comment.