2017-06-10 75 views
0

我想通过在R 2与一个给定的审查矢量施加到下面的数据来估计威布尔分布的极大似然参数:拟合Weibull分布于截尾数据

数据= 9 2 11 49 7 5 3 36 30 6 62 5 3 29 29 1 13 1 24 11 9 4 7 15 11 15 1 1 1 1 1 2 6 12 12 28 14 14 57 17 4 2 3 6 21 6 16 19 28 18 19 9 59 12 3 27 8 26 19 47 68 17 15 25 25 6 54 1 2 11 4 1 36 2 5 5 3 38 3 1 10 69 1 8 3 17 21 19 11 1 6 1 1 18 2 51 6 12 11 13 3 19 16 18 28 10 26 32 6 25 1 44

cens = 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1

如果有人能帮助我,我将非常感激。

+0

请看看如何制作一个很好的重现示例[here](https://stackoverflow.com/a/5963610/7306168) – Bea

回答

0

使用Abrem包:

install.packages("abrem", repos="http://R-Forge.R-project.org") 

您可能需要,如果您有问题需要手动安装RccpArmadillo的旧版本,像我一样:

install.packages("https://cran.r-project.org/src/contrib/Archive/RcppArmadillo/RcppArmadillo_0.6.100.0.0.tar.gz", repos=NULL, type="source") 

然后有它:

library(abrem) 

a = Abrem(fail = c(2, 11, 49, ...), susp = c(9, 44)) 
a = abrem.fit(a, dist = 'weibull', method.fit = 'mle') 
a = abrem.conf(a) # add 90% confidence bands 
plot.abrem(a) # plot the points and fit distribution 
print.abrem(a) # print the results, which includes the fitted parameters 

我可能会混淆你的失败与暂停数据,但希望这个例子使它明确每一个去哪里。