, 나는 이러한 오류를 얻을 말한다 :OpenBUGS가 WinBUGS에서 수렴하는 모델에서 수렴하지 못합니다. 정밀도 제한? 내가 <code>BRugsFit</code> (<code>coda=T</code>와 함께)를 사용하여 R에서의 Winbugs에서 잘 작동 코드와 데이터를 실행하려고하면이 게시물의 제목으로
Error in glm.fit(x = structure(c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, :
NA/NaN/Inf in foreign function call (arg 1)
In addition: Warning messages:
1: glm.fit: algorithm did not converge
2: glm.fit: algorithm did not converge
3: glm.fit: algorithm did not converge
4: glm.fit: algorithm did not converge
5: step size truncated due to divergence
난에 tail()
작업을 수행 할 때 코다 객체, 나는 같은 번호를 반복해서 얻는다. 반면 WinBUGS를 실행하고 코다를 저장 한 다음 R에로드하면 기대했던 것과 같은 확률적인 변형이 생기고 컨버전스에 대한 경고는 표시되지 않습니다.
내 모델은 Logistic-Makeham 배포판의 매개 변수에 대한 사후를 찾기 위해 '1 트릭'을 사용합니다. 여기
model {
for(i in 1:n){
ones[i]<-1;
# here I pre-calculate two quantities that occur several times
# in the PDF, to save a little processing time
expbx[i] <- exp(b*x[i]); expbx1[i]<- 1/(1+sd*(expbx[i]-1));
# below is the actual PDF
p[i]<-(c+a*expbx[i]*expbx1[i])*exp(-c*x[i])*pow(expbx1[i],1/s);
# the ones trick
ones[i]~dbern(p[i]);
}
b~dunif(0,1); d~dexp(1); c~dexp(1); s.raw~dflat();
# a (lambda) parametrized this way because it comes out more accurate
# s forced to be > 0
a<-b*d; s<-abs(s.raw);
# NOT a standard deviation, just s times d, to save processing time
sd<-s*d;
# I save all the parameters I'm interested in to one vector, for convenient
# viewing of them all in the same window.
out[1]<-a; out[2]<-b; out[3]<-c; out[4]<-s; out[5]<-d;
}
내 데이터의 전형적인 예입니다
list(n= 148 ,x=c(1246,1175,1048,1169,1043,802,543,719,1296,817,1122,542,839,443,1536,700,834,232,596,1096,1118,957,974,1031,1149,1044,1108,
519,677,569,952,1243,970,1736,1262,1026,979,1543,1029,761,533,540,511,1150,1589,1169,1029,1248,1572,638,731,525,968,1467,1596,1077,712,1603,1
203,991,37,1775,893,993,913,1487,1186,1381,977,1247,857,786,615,733,1206,1059,1508,569,1205,754,886,1099,843,599,780,1294,1603,1242,883,1320,
507,1097,1193,218,1362,1181,1118,453,1291,972,787,1061,1097,1100,1117,1174,596,1305,1071,940,919,999,1209,1043,1161,1016,1025,750,423,732,
1389,907,1184,1275,944,1209,1073,1098,1348,976,817,557,211,961,880,1039,1287,736,1400,1757,1355,977,198,689,853,1251,767,768))
... 전형적인는 inits
list(d=0.001738,b=0.0009672,c=0.002451,s.raw=0.001511)
list(d=0.006217,b=0.005596,c=0.00777,s.raw=0.007019)
list(d=1.504E-05,b=4.825E-06,c=2.172E-07,s.raw=6.104E-05)
list(d=0.3011,b=0.03552,c=0.1274,s.raw=0.2549)
(I 20 숱이 4 개 체인, 번인 2000, 20000 반복 사용)
OpenBUGS는 WinBUGS보다 더 적은 유효 자릿수로 반올림합니까? 그렇다면 설정을 변경하여 그 작업을 중단 할 수 있습니까? 이 내 임시 답변의 조합이 될 것으로 보인다
+1, 문제의 카테고리에만 해당됩니다. 버그를 적용한 사람을 만나서 기쁩니다. – duffymo
JAGS를 사용해 보셨습니까? 일반적으로, 까다로운 문제조차도, 버그와 같은 블랙 박스 샘플러는 매우 민감 할 수 있습니다 ... –
나는 그것을 시도해 볼 의향이 있습니다. 너무 긴장 되나요? WinBUGS에는이 기능이없는 꽤 끔찍한 자기 상관 관계가 있습니다. 또한 JAGS에서 WinBUGS의 다중 체인 기능을 복제하는 것은 여러 JAGS를 실행 한 다음 수동으로 하나의 coda로 결합하는 것과 같이 간단합니다. – f1r3br4nd