以分组方式拟合Weibull分布中的数据?

时间:2017-05-25 05:04:44

标签: r reliability weibull

可靠性建模:计算形状和比例以识别仪器或传感器的寿命。以下是我一直试图以组方式计算形状和比例参数的事情,并且为各个分组标准创建和形状和比例参数我得到一个错误Error in summarise_impl(.data, dots) : non-finite value supplied by optim我知道有些身体粘贴了相同的查询,但它不是一个正确的形式请在下面指导我是我得到的代码和观察到的错误。

G= c("P52" ,"P52","P66 - PARK II","P66 - PARK II" ,"P66 - PARK II" ,"P66 - PARK II" ,"P82 V3","P82 V3","P82 V3","P52","P52","P66 - PARK II" ,"P66 - PARK II" ,"P82 V3","P66 - PARK II" ,"P66 - PARK II" ,"P82 V3","P82 V3"        ,"P88","P88","P88","P52","P82 V3","P66 - PARK II" ,"P66 - PARK II" ,"P82 V3","P52","P88","P88","P52" ,"P88","P82 V3","P88","P82 V3","P82 V3","P82 V3","P88","P88","P66 - PARK II" ,"P66 - PARK II" ,"P66 - PARK II" ,"P66 - PARK II" ,"P88","P66 - PARK II" ,"P88"           ,"P52","P52","P52","P52","P52","P52","P66 - PARK II" ,"P66 - PARK II" ,"P66 - PARK II","P88","P82 V3","P82 V3","P88","P88","P66 - PARK II" ,"P66 - PARK II" ,"P52","P52","P66 - PARK II" ,"P66 - PARK II" ,"P66 - PARK II" ,"P66 - PARK II" ,"P66 - PARK II" ,"P66 - PARK II" ,"P66 - PARK II" ,"P66 - PARK II" ,"P66 - PARK II","P66 - PARK II" ,"P82 V3","P66 - PARK II" ,"P82 V3","P88","P82 V3","P88","P88","P66 - PARK II","P82 V3","P82 V3" ,"P66 - PARK II" ,"P66 - PARK II" ,"P66 - PARK II" ,"P82 V3","P88","P88","P82 V3","P66 - PARK II" ,"P66 - PARK II" ,"P66 - PARK II" ,"P66 - PARK II" ,"P66 - PARK II" ,"P66 - PARK II" ,"P88"           ,"P66 - PARK II" ,"P66 - PARK II","P66 - PARK II" )
GA = c(   170 ,170 ,169 ,135 ,135 ,135 ,331 ,331 ,331 ,136 ,170 ,169 ,169 ,183 ,135 ,135 ,331 ,331 ,431 ,431 ,183 ,170 ,183 ,135 ,135 ,331 ,136  ,94 ,115 ,136 ,154 ,103 ,183 ,114 ,114 ,114 ,183 ,149  ,51
            ,169 ,169 ,135  ,94 ,136 ,117 ,170 ,170 ,170 ,170 ,170 ,170 ,51 ,169 ,169 ,364 ,183 ,183  ,94 ,364 ,114  ,51 ,113 ,170  ,51 ,169 ,170 ,169 ,169 ,135 ,135 ,135 ,135 ,170 ,103 ,117 ,103  ,10  ,10
            ,183 ,183 ,111 ,103 ,150 ,137 ,137 ,137  ,10  ,10  ,95 ,103 ,169 ,169 ,170 ,169 ,169 ,169  ,10 ,137 ,137 ,137)
GL = c(  1645 ,1645 ,1645 ,1645 ,1645 ,1645 ,1645 ,1645 ,1645 ,1645 ,1646 ,1646 ,1646 ,1646 ,1646 ,1646 ,1646 ,1646 ,1647 ,1647 ,1647 ,1647 ,1647 ,1647 ,1647 ,1647 ,1647 ,1648 ,1648 ,1648 ,1648
           ,1649 ,1649 ,1649 ,1649 ,1649 ,1649 ,1649 ,1649 ,1649 ,1649 ,1649 ,1649 ,1650 ,1650 ,1650 ,1650 ,1650 ,1650 ,1650 ,1650 ,1650 ,1650 ,1650 ,1650 ,1650 ,1650 ,1650 ,1650 ,1651 ,1651 ,1651
           ,1651 ,1651 ,1651 ,1651 ,1651 ,1651 ,1651 ,1651 ,1651 ,1651 ,1651 ,1651 ,1651 ,1651 ,1651 ,1653 ,1653 ,1653 ,1653 ,1653 ,1653 ,1654 ,1654 ,1654 ,1654 ,1654 ,1654 ,1654 ,1654 ,1654 ,1654
           ,1654 ,1654 ,1654 ,1654 ,1655 ,1655 ,1655)


df=data.frame(G=G,GA=GA,GL=GL)

library(MASS)
library(dplyr)
by_G<- group_by(df,G,GA)
fg1 <- summarise(by_G,
                 shape=fitdistr(GL, "weibull")$estimate[1],
                 scale=fitdistr(GL, "weibull")$estimate[2],
                 n=n())

观察到错误

Error in summarise_impl(.data, dots) : non-finite value supplied by optim

0 个答案:

没有答案