看板 Statistics 關於我們 聯絡資訊
[軟體程式類別]: openBUGS [程式問題]: openBUGS要進行update卻出現 "***Sorry something went wrong in procedure Ln in module Math***" [軟體熟悉度]: 新手 [問題敘述]: 我想用openBUGS來處理含有 right censored和interval censored資料型態 的model裡的參數估計問題 假設資料來自log-logistic(α,β)分配 資料的型態為(x,t1,t2,d),x為解釋變數, t1為區間開始時間,t2為區間結束時間,d為指標,right censored=0,interval censored=1 即right censored=(x,t1,inf,0),interval censored=(x,t1,t2,1) 為了輸入data方便我把它改成t1=t,t2=t1+k=t+k,inf=0 right censored=(x,t,0,0),interval censored=(x,t,t+k,1) 令α=b0+b1*x+b2*x^2,π=(a2+(1-a2)*exp(-exp(a0-a1*x))) 總之,每筆資料對應到的概似機率為 L=(((π)+(1-π)*(1+(t/α)^β)^(-1)-k)^(1-d)) *((1-π)*((1+(t/α)^β)^(-1)-(1+((t+k)/α)^β)^(-1)))^d 所以t~dloglik(logL),要估β,a0,a1,a2,b0,b1,b2 打完code放到openBUGS執行 check model,load data,compile都可以執行 但要進行update卻出現 "***Sorry something went wrong in procedure Ln in module Math***" 爬過文有試過用較簡單的model減少要估計的參數的個數 還是出現同樣問題 完全不清楚到底哪裡有問題....求版上高手解救.... [程式範例]: 以下是我打的code http://pastie.org/10953126 但卻無法updata,求高手解救,謝謝~ -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.112.74.231 ※ 文章網址: https://www.ptt.cc/bbs/Statistics/M.1477907578.A.E57.html
b10009047: 若是先計算出log likelihood的式子再將資料代入呢? 10/31 23:35
b10009047: 可能是因為各別的pdf太小,導致相乘後趨近於0,取對數會 10/31 23:35
b10009047: 出問題 10/31 23:35