r-statistics-fanの日記

統計好き人間の覚書のようなもの

LED電球逝く~ワイブル分布で解析する

LEDライトが1年で逝った。
超損した気分。

悔しいので、ワイブル分布で平均寿命10年の際に1年で
逝く可能性がどんなもんか計算してみる。

f:id:r-statistics-fan:20141031231623j:plain

###LEDライト

sh <- seq(1, 10, by = 1)      #shape
sc <- 10 / gamma(1 + 1 / sh)  #scale  平均生存期間 10 year

pv <- res <- numeric(length(sh))
cols = rainbow(length(sh), start = 0.5, end = 0.1)

windows()
plot(1, type = "n", ylim = c(0,1), xlim = c(0, 15), xlab = "year", ylab = "survival rate")
for(i in seq_len(length(sh))){
res[i] <- qweibull(0.975, shape = sh[i], scale = sc[i], lower.tail = FALSE)
pv[i] <- pweibull(1, shape = sh[i], scale = sc[i], lower.tail = TRUE)
curve(exp(-(x/sc[i])^sh[i]), from =0, to = 15, ylim = c(0,1), xlim = c(0, 15), 
      xlab = "", ylab = "", add = TRUE, col = cols[i])
}
abline(v = c(1,10), h = 0.975, lty =3)
legend("bottomleft", legend = c(sh), pch = c(18,4), lty =3, col = cols,
       box.lwd = 3,   box.lty = 3,  text.col = cols, title = "shape", title.col = "black")

pv   #1年で逝く確率
res  #95%CIの悪い方

> pv   #1年で逝く確率
 [1] 9.516258196e-02 7.823219707e-03 7.118194789e-04 6.749470106e-05 6.525459553e-06 6.375283555e-07
 [7] 6.267633928e-08 6.186686329e-09 6.123599640e-10 6.073048362e-11
> options(digits = 10)
> round(1/pv)
 [1]          11         128        1405       14816      153246     1568558    15954984   161637417
 [9]  1633026420 16466195234
> res  #95%CIの悪い方
 [1] 0.2531780798 1.7954284812 3.2882679990 4.4008386055 5.2211084777 5.8410072181 6.3227092225
 [8] 6.7065011033 7.0188960821 7.2778304920

どう考えても、指数分布的に壊れる感じはしないが、指数分布であれば
平均寿命10年の場合、1年で逝く確率は9.5%程度もある。11人に一人
1年で壊れる。97.5%タイル点は0.253で、3ヶ月くらい。
これはいくらなんでも無いかな。こんなんだったら保証してほしいわ。

消費者の印象としてはshape=5以上な気がする。
shape=5ならば、1年で逝く確率は0.0000065しかない。153246人に一人。
97.5%タイルは5年位になる。こんなもんかなと思うが、壊れ方のデータ
がないので分かんないというのが現実。