
RankAdjustment¶
-
class
reliability.Nonparametric.
RankAdjustment
(failures=None, right_censored=None, print_results=True, a=None, show_plot=True, plot_CI=True, CI=0.95, plot_type='SF', **kwargs)¶ Uses the rank-adjustment estimation method to calculate the reliability from failure data. Right censoring is supported and confidence bounds are provided.
Parameters: - failures (array, list) – The failure data. Must have at least 2 elements.
- right_censored (array, list, optional) – The right censored data. Optional input. Default = None.
- show_plot (bool, optional) – True or False. Default = True
- print_results (bool, optional) – Prints a dataframe of the results. True or False. Default = True
- plot_type (str) – Must be either ‘SF’, ‘CDF’, or ‘CHF’. Default is SF.
- CI (float, optional) – confidence interval for estimating confidence limits on parameters. Must be between 0 and 1. Default is 0.95 for 95% CI.
- plot_CI (bool) – Shades the upper and lower confidence interval. True or False. Default = True
- a - int,float,optional – The heuristic constant for plotting positions of the form (k-a)/(n+1-2a). Optional input. Default is a=0.3 which is the median rank method (same as the default in Minitab). Must be in the range 0 to 1. For more heuristics, see: https://en.wikipedia.org/wiki/Q%E2%80%93Q_plot#Heuristics
- kwargs – Plotting keywords that are passed directly to matplotlib for the plot (e.g. color, label, linestyle)
Returns: - results (dataframe) – A pandas dataframe of results for the SF
- RA (array) – The Rank Adjustment Estimate column from results dataframe. This column is the non-parametric estimate of the Survival Function (reliability function).
- xvals (array) – the x-values to plot the stepwise plot as seen when show_plot=True
- SF (array) – survival function stepwise values (these differ from the RA values as there are extra values added in to make the plot into a step plot)
- CDF (array) – cumulative distribution function stepwise values
- CHF (array) – cumulative hazard function stepwise values
- SF_lower (array) – survival function stepwise values for lower CI
- SF_upper (array) – survival function stepwise values for upper CI
- CDF_lower (array) – cumulative distribution function stepwise values for lower CI
- CDF_upper (array) – cumulative distribution function stepwise values for upper CI
- CHF_lower (array) – cumulative hazard function stepwise values for lower CI
- CHF_upper (array) – cumulative hazard function stepwise values for upper CI
- data (array) – the failures and right_censored values sorted. Same as ‘Failure times’ column from results dataframe
- censor_codes (array) – the censoring codes (0 or 1) from the sorted data. Same as ‘Censoring code (censored=0)’ column from results dataframe
Notes
The confidence bounds are calculated using the Greenwood formula with Normal approximation, which is the same as featured in Minitab.
The rank-adjustment method provides the SF. The CDF and CHF are obtained from transformations of the SF. It is not possible to obtain a useful version of the PDF or HF as the derivative of a stepwise function produces discontinuous (jagged) functions.
The Rank-adjustment algorithm is the same as is used in Probability_plotting.plotting_positions to obtain y-values for the scatter plot. As with plotting_positions, the heuristic constant “a” is accepted, with the default being 0.3 for median ranks.