Skip to main content

Weibull Analysis Utilities

Project description

predictr

Weibull Analysis Utilities

Installation

Use the package manager pip to install predictr.

pip install predictr

Usage

Import predictr in python

from predictr import Analysis

Default Parameter values

df: list = None -> failures in seconds, days, bo. of cycles etc., e.g. df = [100, 120, 80, 300]
ds: list = None -> suspensions (right-censored) in seconds, days, bo. of cycles etc., e.g. ds = [300, 400, 400]
show: bool = False -> If True, the Weibull probability plot will be plotted.
plot_style = 'ggplot' -> Choose a style according to your needs. See https://matplotlib.org/3.1.0/gallery/style_sheets/style_sheets_reference.html for styles.
bounds=None -> Use following table to configure everything related to confidence bounds, e.g. if you want to use Monte-Carlo pivotal bounds for the Median Rank Regression: bounds = 'mcpb'.

confidence bounds mle() mrr() uncensored data censored data type argument value
Beta-Binomial Bounds - x x x '2s', '1sl', '1su' 'bbb'
Monte-Carlo Pivotal Bounds - x x x '2s', '1sl', '1su' 'mcpb'
Non-Parametric Bootstrap Bounds x x x - '2s', '1sl', '1su' 'npbb'
Parametric Bootstrap Bounds x x x - '2s', '1sl', '1su' 'pbb'
Fisher Bounds x - x x '2s', '1sl', '1su' 'fisher'
Likelihood Ratio Bounds x - x x '2s', '1sl', '1su' 'lrb'

bounds_type = '2s' -> '2s': two-sided confidence bounds, '1su': upper confidence bounds, '1sl': lower confidence bounds. E.g. bounds_type = '1sl'.
cl=0.9 -> configure the confidence level in the intervall (0, 1.0)
bcm=None -> Define the bias-correction method when the MLE is being used. Bootstrap bias-corrections are dependent on the number of bootstrap replication and the chosen statistic, e.g. if bcm = 'np_bs': bs_size = 5000 and est_type = 'median'.
bs_size = 5000 -> Resampling/Bootstrap sample size (number of replication). bs_size should be greater than or equal to 2000 for accurate results. The higher the nuber of replication, the longer it takes to compute the bias-correction.
est_type = 'median' -> When using bootstrap bias-corrections, this argument decides which statistic to compute from the bootstrap samples.
The following table provides possible configurations. Bias-corrections for mrr() are not supported, yet.

Bias-correction method mle() mrr() argument value config. statistic
C4 x - 'c4' - -
hrbu x - 'hrbu' - -
non-parametric Bootstrap correction x - 'np_bs' bs_size 'mean', 'median', 'trimmed_mean'
Parametric Bootstrap correction x - 'p_bs' bs_size 'mean', 'median', 'trimmed_mean'

unit = '-' -> Unit of the elements in df and ds, e.g. unit = 'seconds', unit = 'days', unit = 'ms' etc.

How to use the Maximum Likelihood Estimation (MLE)

Just add '.mle()' after Analysis() object = Analysis().mle()

Uncensored sample

Example:

failures = [0.4508831,  0.68564703, 0.76826143, 0.88231395, 1.48287253, 1.62876357]
prototype_a = Analysis(df=failures, bounds='fisher',show=True).mle()

Censored sample

Example:

failures = [0.4508831,  0.68564703, 0.76826143, 0.88231395, 1.48287253, 1.62876357]
suspensions = [1.9, 2.0, 2.0]
prototype_a = Analysis(df=uncen_sample, bounds='lrb',show=True).mle()

How to use the Maximum Rank Regression (MRR)

Just add '.mrr()' after Analysis() object = Analysis().mrr()

Uncensored sample

Example:

failures = [0.4508831,  0.68564703, 0.76826143, 0.88231395, 1.48287253, 1.62876357]
prototype_a = Analysis(df=failures, bounds='bbb',show=True).mrr()

Censored sample

Example:

failures = [0.4508831,  0.68564703, 0.76826143, 0.88231395, 1.48287253, 1.62876357]
suspensions = [1.9, 2.0, 2.0]
prototype_a = Analysis(df=failures, ds=suspensions, bounds='mcpb',show=True).mrr()

To Do

I will add a homepage with more detailed examples and guidelines for non-experts in the field of reliability engineering.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

predictr-0.1.4.tar.gz (1.7 MB view details)

Uploaded Source

Built Distribution

predictr-0.1.4-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file predictr-0.1.4.tar.gz.

File metadata

  • Download URL: predictr-0.1.4.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for predictr-0.1.4.tar.gz
Algorithm Hash digest
SHA256 72537a1021cb278de58eb49b65fd791caf1bf7c361a6851d6dc98147ff4df010
MD5 a7def2d11878d905475548668e241acd
BLAKE2b-256 d95083c96c320fac39d202c40a2b4980f8eccd5a8c13f169bbbb87e4c8a38f01

See more details on using hashes here.

File details

Details for the file predictr-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: predictr-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 18.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for predictr-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0bb7fce69e24ad41e44800b6196bb30cc213b9e1d09e4f831e59f8094d8029e7
MD5 a0c6458a9c9bcabeca000422a0d407ce
BLAKE2b-256 912132d15bb450c29a4f84f2509972c06585f388676083d649401996dfd6a4e2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page