https://raw.githubusercontent.com/MatthewReid854/reliability/master/docs/images/logo.png

Fit_Weibull_2P_grouped

class reliability.Fitters.Fit_Weibull_2P_grouped(dataframe=None, show_probability_plot=True, print_results=True, CI=0.95, force_beta=None, percentiles=None, method='MLE', optimizer=None, CI_type='time', **kwargs)

Fits a 2-parameter Weibull distribution (alpha,beta) to the data provided. The data input is a dataframe which allows for efficient handling of large volumes of grouped data. This is almost identical to Fit_Weibull_2P except for the input format. There may be small differences in results due to the initial guess (scipy or least squares), the optimizer (L-BFGS-B or TNC), and rounding errors when processing very heavily censored data.

Inputs: dataframe - a pandas dataframe of the appropriate format. See the example below. show_probability_plot - True/False. Defaults to True. print_results - True/False. Defaults to True. Prints a dataframe of the point estimate, standard error, Lower CI and Upper CI for each parameter. CI - confidence interval for estimating confidence limits on parameters. Must be between 0 and 1. Default is 0.95 for 95% CI. force_beta - Use this to specify the beta value if you need to force beta to be a certain value. Used in ALT probability plotting. Optional input. method - ‘MLE’ (maximum likelihood estimation), ‘LS’ (least squares estimation), ‘RRX’ (Rank regression on X), ‘RRY’ (Rank regression on Y). LS will perform both RRX and RRY and return the better one. Default is ‘MLE’. optimizer - ‘L-BFGS-B’, ‘TNC’, or ‘powell’. These are all bound constrained methods. If the bounded method fails, nelder-mead will be used. If nelder-mead fails then the initial guess will be returned with a warning. For more information on optimizers see https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize.html#scipy.optimize.minimize CI_type - time, reliability, None. Default is time. This is the confidence bounds on time or on reliability. Use None to turn off the confidence intervals. percentiles - percentiles to produce a table of percentiles failed with lower, point, and upper estimates. Default is None which results in no output. True or ‘auto’ will use default array [1, 5, 10,…, 95, 99]. If an array or list is specified then it will be used instead of the default array. kwargs are accepted for the probability plot (eg. linestyle, label, color)

Outputs: alpha - the fitted Weibull_2P alpha parameter beta - the fitted Weibull_2P beta parameter loglik - Log Likelihood (as used in Minitab and Reliasoft) loglik2 - LogLikelihood*-2 (as used in JMP Pro) AICc - Akaike Information Criterion BIC - Bayesian Information Criterion AD - the Anderson Darling (corrected) statistic (as reported by Minitab) distribution - a Weibull_Distribution object with the parameters of the fitted distribution alpha_SE - the standard error (sqrt(variance)) of the parameter beta_SE - the standard error (sqrt(variance)) of the parameter Cov_alpha_beta - the covariance between the parameters alpha_upper - the upper CI estimate of the parameter alpha_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) percentiles - a dataframe of the percentiles with bounds on time. This is only produced if percentiles is ‘auto’ or a list or array. Since percentiles defaults to None, this output is not normally produced. probability_plot - the axes handle for the probability plot (only returned if show_probability_plot = True)

Requirements of the input dataframe: The column titles MUST be ‘category’, ‘time’, ‘quantity’ The category values MUST be ‘F’ for failure or ‘C’ for censored (right censored). The time values are the failure or right censored times. The quantity is the number of items at that time. This must be specified for all values even if the quantity is 1.

Example of the input dataframe: category time quantity

F 24 1 F 29 1 F 34 1 F 39 2 F 40 1 F 42 3 F 44 1 C 50 3 C 55 5 C 60 10

This is easiest to achieve by importing data from excel. An example of this is: import pandas as pd from reliability.Fitters import Fit_Weibull_2P_grouped filename = ‘C:UsersCurrent UserDesktopdata.xlsx’ df = pd.read_excel(io=filename) Fit_Weibull_2P_grouped(dataframe=df)

static LL(params, T_f, T_rc, Q_f, Q_rc)
static LL_fb(params, T_f, T_rc, Q_f, Q_rc, force_beta)
static logR(t, a, b)
static logf(t, a, b)