python拟合威布尔参数,拟合3参数的威布尔分布

本文介绍了如何在Python中使用自定义方法来拟合3参数的威布尔分布。通过修改dweibull函数并利用nlminb进行非线性最小二乘拟合,解决了fitdistr函数在某些情况下出现警告和错误的问题。
摘要由CSDN通过智能技术生成

I have been doing some data analysis in R and I am trying to figure out how to fit my data to a 3 parameter Weibull distribution. I found how to do it with a 2 parameter Weibull but have come up short in finding how to do it with a 3 parameter.

Here is how I fit the data using the fitdistr function from the MASS package:

y

x[[6]] is a subset of my data and y is where I am storing the result of the fitting.

解决方案

First, you might want to look at FAdist package. However, that is not so hard to go from rweibull3 to rweibull:

> rweibull3

function (n, shape, scale = 1, thres = 0)

thres + rweibull(n, shape, scale)

and similarly from dweibull3 to dweibull

> dweibull3

function (x, shape, scale = 1, thres = 0, log = FALSE)

dweibull(x - thres, shape, scale, log)

so we hav

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值