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.2.tar.gz (18.1 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: predictr-0.1.2.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • 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.2.tar.gz
Algorithm Hash digest
SHA256 310e9b46d02c2d3480574835eb12d9445447df59314809095d6782ba87c6ac9b
MD5 82f91e8266d2e55920c357a24c4f90c1
BLAKE2b-256 1e5120622e2f9ff6661e74f914d75e8c4377a0749fa381a963edc94adc2e953f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: predictr-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3f6727a06b3178940190d6699e3c875b5d4d6f05ee02384bb43f5e98dd885e23
MD5 700911b1baae77a1f6bedd6368698b71
BLAKE2b-256 28c10388118d26779754ce8559cd99344a3213de951cb5e53cf0ad05bc36e05e

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