韦伯尔分布/威布尔分布/Weibull distribution 置信区间确定
韦布尔分布理论介绍见:
Equations of supported distributions — reliability 0.8.3 documentation
韦伯分布(威布尔分布,Weibull distribution)_心态与做事习惯决定人生高度的博客-CSDN博客_威布尔分布
其pdf, cdf为:
那么可以根据散点的方法确定置信区间。其思路为采用多个散点,基于分布函数(Distribution Function,CDF),找到相应的分位数就可以。比如95%的置信区间,可以确定0.25 和0.975所对应的x值,进而确定相应的置信区间。
这里需要注意的是,威布尔分布是非对称分布,不可以根据解析式确定精确的置信区间。在部分文章里有关于非对称分布的近似求解方法,但求得的结果与置信区间有误差,故本文没采用。感兴趣的读者可参考 https://en.wikipedia.org/wiki/Confidence_interval。
相关代码见:
import numpy as np
import matplotlib.pyplot as plt# define the pdf of weibull distribution
def weibpdf(x, scale, shape):return (shape / scale) * (x / scale)**(shape - 1) * np.exp(-(x / scale) ** shape)
# define the cdf of weibull distribution
def weibcdf(x, scale, shape):return 1 - np.exp( -1 * (x/scale) ** shape)
# define the confidence interval of weibull distribution
def weib_confidence_interval(scale, shape, confidence_level = 0.95, sampleNum = 50000):assert(sampleNum >= 1000)x = np.linspace(1, scale * 3, sampleNum)ycdf = np.array( list( map(weibcdf, x, np.ones(len(x)) * scale, np.ones(len(x)) * shape) ))lower_level, upper_level = 0.5 * (1 - confidence_level), confidence_level + 0.5 * (1 - confidence_level)x_lower_level = x[np.min( np.where(ycdf >= lower_level))]x_upper_level = x[np.min( np.where(ycdf >= upper_level))]print('scale, shape, confidence level', scale, shape, confidence_level)print('confidence interval',x_lower_level, x_upper_level, 'corresponding cdf', weibcdf(x_lower_level, scale, shape), weibcdf(x_upper_level, scale, shape))return x_lower_level, x_upper_levelscales, shapes = [50, 50, 50, 30, 70], [1.5, 2.5, 3.5, 1.5, 1.5]
colors = ['b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'][:len(shapes)]
for scale, shape, color in zip(scales, shapes, colors):#x = np.arange(1, scale*3)x = np.linspace(1, scale * 3, 1000)ypdf = np.array( list( map(weibpdf, x, np.ones(len(x)) * scale, np.ones(len(x)) * shape) ))ycdf = np.array( list( map(weibcdf, x, np.ones(len(x)) * scale, np.ones(len(x)) * shape) ))x_lower_level, x_upper_level = weib_confidence_interval(scale, shape)plt.subplot(2,1,1)plt.plot(x, ypdf, color = color , label='scale=%d, shape=%0.2f'%(scale, shape))plt.legend()plt.subplot(2,1,2)plt.plot(x, ycdf, color = color , label='scale=%d, shape=%0.2f'%(scale, shape))for xi in [x_lower_level, x_upper_level]:plt.vlines(xi, ymin= 0, ymax=1, color = color , linestyles='--', linewidth = 0.5)plt.legend()
plt.show()
结果:
韦伯尔分布/威布尔分布/Weibull distribution 置信区间确定相关推荐
- 怎么画韦布尔分布_手机按键寿命测试的样本数量怎么定?一文看懂 简述威布尔分布及其应用...
有一种手机按键的质量要求是,95%的产品的按压寿命需要达到1万次. 根据这一要求,QC部门需要进行1.2万次的按压测试. 那么QC部门需要选取多少按键来进行测试(不允许有失效),才能保证95%的按键按 ...
- R语言使用qweibull函数生成威布尔(韦伯分布)分布分位数函数数据、使用plot函数可视化威布尔分布分位数函数数据(Weibull Distribution)
R语言使用qweibull函数生成威布尔(韦伯分布)分布分位数函数数据.使用plot函数可视化威布尔分布分位数函数数据(Weibull Distribution) 目录
- R语言使用rweibull函数生成符合威布尔(韦伯分布)分布的随机数、使用plot函数可视化符合威布尔(韦伯分布)分布的随机数(Weibull Distribution)
R语言使用rweibull函数生成符合威布尔(韦伯分布)分布的随机数.使用plot函数可视化符合威布尔(韦伯分布)分布的随机数(Weibull Distribution) 目录
- R语言使用pweibull函数生成威布尔(韦伯分布)分布累积分布函数数据、使用plot函数可视化威布尔分布累积分布函数数据(Weibull Distribution)
R语言使用pweibull函数生成威布尔(韦伯分布)分布累积分布函数数据.使用plot函数可视化威布尔分布累积分布函数数据(Weibull Distribution) 目录
- R可视化绘制威布尔分布(Weibull Distribution)
R可视化绘制威布尔分布(Weibull Distribution) 韦布尔分布,即韦伯分布(Weibull distribution),又称韦氏分布或威布尔分布,是可靠性分析和寿命检验的理论基础. 威 ...
- Weibull分布(韦伯分布、威布尔分布)
本文转载自: https://www.cnblogs.com/wwxbi/p/6141501.html 作者:wwxbi 转载请注明该声明. log函数 从概率论和统计学角度看,Weibull Dis ...
- 双参数威布尔分布(Weibull分布)参数计算(根据故障数据,求双参数威布尔分布的参数详细步骤)
根据故障数据求威布尔分布参数步骤 根据众多文献研究,设备故障数据大多服从指数分布.威布尔分布或对数正态分布.其中威布尔分布较为常用,本文主要介绍威布尔分布的简单应用,并根据某设备故障数据为例简单介绍威 ...
- Python威布尔分布
文章目录 威布尔分布及其性质 在Python中生成威布尔分布的随机数 指数分布和拉普拉斯分布的对比 威布尔分布及其性质 威布尔分布,即Weibull distribution,又被译为韦伯分布.韦布尔 ...
- 【基础教程】Matlab实现指数威布尔分布
1 内容介绍 韦布尔分布,即韦伯分布(Weibull distribution),又称韦氏分布或威布尔分布,是可靠性分析和寿命检验的理论基础. 威布尔分布在可靠性工程中被广泛应用,尤其适用于机电类产品 ...
最新文章
- 分库分表需要考虑的问题及方案
- html弧形列表效果,web前端入门到实战:html5网页特效-弧形菜单
- Maven学习-目录结构
- 【Python】Numpy中伪随机数的简单使用
- LINQ 优点 总结
- Redis安装+启动报错
- linux 路由表(转)
- wxcharts.js结合java后台在小程序中的使用(柱状图,其它同理)
- TCP、UDP、HTTP、SOCKET、WebSocket之间的区别
- php 阿里云短信验证码
- amoeba实现mysql主从读写分离_MySQL+Amoeba实现数据库主从复制和读写分离
- Java 版本中文数字转阿拉伯数字实现
- 牛客刷题:放苹果(编程题)
- 使用ffmpeg将视频切片并加密
- html 设置表格间距 表格整体大小,css表格单元格间距怎么调整?
- java基础--Java入门
- 连续语音信号的短时倒谱分析及其参数用途
- linux下c/c++读取txt文件,多行文件,且每行都用逗号隔开
- python实现数据可视化软件_基于Python实现交互式数据可视化的工具
- 建议收藏,SCI期刊实时影响因子的意义和算法
热门文章
- UE4如何接入科大讯飞的语音识别
- BAE 升级discuz x2.5 论坛安全问题的方式
- UML设计系列(4):用例图
- html2canvas 报错:Failed to execute ‘toDataURL‘ on ‘HTMLCanvasElement : Tainted canvases may not be ...
- galera mysql ubuntu_Ubuntu14.04安装Mysql Galera Cluster
- 记录cacl()函数中使用scss变量不生效的问题
- 不要把希望寄托在别人身上
- jupyter notebook打不开浏览器 或出现端口被占用该如何解决
- c++ 11 nullptr
- PACS系统源码:CT后处理技术之仿真内镜CTVE