for those who are interested in Bayesian copula estimations, attached is the
code which I have got from Arkady Shemyakin.
Below is also the link to the background paper:
Shemyakin and Youn, 2006. Copula models of joint last survivor analysis.
Applied Stochastic Models in Business and Industry, Vol.22, pp.211-224
http://www3.interscience.wiley.com/journal/112586481/abstract?
CRETRY=1&SRETRY=0
Raushan
-------------------------------------------------------------------
This list is for discussion of modelling issues and the BUGS software.
For help with crashes and error messages, first mail [log in to unmask]
To mail the BUGS list, mail to [log in to unmask]
Before mailing, please check the archive at www.jiscmail.ac.uk/lists/bugs.html
Please do not mail attachments to the list.
To leave the BUGS list, send LEAVE BUGS to [log in to unmask]
If this fails, mail [log in to unmask], NOT the whole list
model
{ for(i in 1 : N)
{ t[i] <- max(min(tf[i]-ef[i],tm[i]-em[i]),.5)
ones[i] <- 1
ones[i] ~ dbern( p[i] )
feta[i]<-fbeta+fbdelta*ef[i]+fbeps*em[i]
famma[i]<-fgamma+fgdelta*ef[i]+fgeps*em[i]
meta[i]<-mbeta+mbdelta*em[i]+mbeps*ef[i]
mamma[i]<-mgamma+mgdelta*em[i]+mgeps*ef[i]
rf[i]<-pow((ef[i]+t[i])/feta[i],famma[i])-pow(ef[i]/feta[i],famma[i])
rm[i]<-pow((em[i]+t[i])/meta[i],mamma[i])-pow(em[i]/meta[i],mamma[i])
p[i] <- pow(
pow(pow(rf[i],alpha)+pow(rm[i],alpha),1/alpha-1)*
(famma[i]/feta[i]*pow((ef[i]+t[i])/feta[i],famma[i]-1)*pow(rf[i],alpha-1)+
mamma[i]/meta[i]*pow((em[i]+t[i])/meta[i],mamma[i]-1)*pow(rm[i],alpha-1)),
1-equals(max(cf[i],cm[i]),0))/
exp(pow(pow(rf[i],alpha)+pow(rm[i],alpha),1/alpha))/1000}
alpha<-1+psi
psi~ dgamma(1,1)
mgamma ~dgamma(20,9.28)
mbeta ~ dgamma(12608,158)
fgamma ~ dgamma(49,33.33)
fbeta ~ dgamma(37914,451)
mgdelta ~ dgamma(314,2243)
mbdelta ~dgamma(118,936)
fgdelta~dgamma(1744,12284)
fbdelta~dgamma(259,2265)
mgeps~dgamma(1,1)
mbeps~dgamma(1,1)
fgeps~dgamma(1,1)
fbeps~dgamma(1,1)
}
list( N=200)
em[ ] tm[ ] cm[ ] ef[ ] tf[ ] cf[ ] 64 66 0 66 69 0
67 72 0 64 66 0
52 53 0 50 51 0
66 70 0 66 70 0
70 75 0 77 79 79
74 79 0 65 70 0
62 66 0 61 64 0
75 80 0 71 76 0
76 80 80 79 84 0
76 81 0 72 77 0
59 61 0 57 59 0
66 71 0 64 69 0
69 73 0 67 71 0
73 76 0 70 73 0
61 65 0 60 64 0
62 67 0 65 70 0
58 60 0 57 59 0
88 89 89 78 82 82
76 81 0 74 79 0
64 69 0 62 67 0
73 75 0 75 77 0
69 74 0 73 78 0
51 56 0 47 52 0
73 78 0 75 80 0
65 68 0 56 58 0
72 77 0 73 78 0
63 66 0 63 66 0
65 68 0 64 67 0
67 72 0 68 72 72
72 77 77 69 74 0
68 73 0 65 70 0
58 63 0 72 77 0
66 71 0 59 64 0
65 68 0 58 61 0
58 63 0 53 58 0
66 68 0 69 71 0
68 72 0 67 70 0
73 78 0 64 69 0
65 67 67 52 57 0
68 73 0 68 73 0
57 61 0 53 57 0
67 72 0 64 69 0
74 79 0 67 72 0
59 61 0 51 54 0
73 78 0 70 75 0
73 78 0 72 77 0
57 62 0 47 52 0
68 73 0 69 74 0
66 71 0 71 76 0
73 78 0 74 75 75
66 71 0 67 72 0
70 73 73 67 70 0
75 80 0 72 77 0
73 78 0 64 69 0
62 66 0 60 64 0
54 57 0 56 59 0
60 65 0 63 68 0
69 74 0 68 73 0
70 75 0 65 70 0
76 81 81 74 78 78
70 75 0 73 78 0
73 78 0 71 76 0
66 70 0 67 71 0
63 67 67 63 68 0
72 77 0 66 71 0
71 76 0 67 72 0
61 62 0 54 55 0
64 66 0 60 62 0
65 67 67 63 67 0
78 79 0 71 72 0
67 68 0 64 65 0
76 81 0 71 76 0
74 79 0 73 78 0
60 64 0 56 60 0
68 69 0 70 71 0
72 74 74 74 79 0
75 80 0 60 65 0
64 69 0 61 66 0
65 67 0 70 73 0
74 79 0 74 79 0
73 78 0 73 78 0
72 77 0 73 78 0
64 67 0 63 65 0
66 71 0 64 69 0
66 71 0 61 66 0
64 69 0 66 71 0
65 69 0 60 64 0
63 67 0 60 63 0
60 64 0 59 63 0
63 68 0 69 74 0
69 72 0 67 70 0
73 77 77 73 78 0
64 69 0 61 66 0
76 81 0 42 47 0
70 75 0 67 72 0
65 70 0 47 52 0
57 62 0 54 59 0
72 77 0 61 66 0
61 66 0 60 65 0
71 73 0 75 77 0
69 74 0 69 74 0
62 67 0 63 68 0
60 63 0 61 64 0
72 77 0 73 78 0
65 68 0 70 72 0
73 78 0 67 72 0
66 70 70 61 66 0
70 75 0 71 76 0
71 75 0 69 73 0
64 69 0 61 66 0
67 72 0 62 67 0
59 62 0 56 59 0
66 71 0 60 65 0
66 71 0 61 66 0
70 75 0 75 79 79
78 83 0 83 88 0
71 76 0 67 72 0
69 74 0 66 71 0
71 76 0 67 72 0
54 57 0 59 61 0
71 75 0 65 69 0
93 96 96 92 93 93
65 66 0 61 62 0
66 71 0 63 68 0
48 53 0 47 52 0
68 73 0 50 55 0
67 72 0 65 70 0
70 75 0 75 79 0
72 76 76 74 79 0
64 66 0 63 64 0
60 64 0 57 61 61
61 66 66 62 67 0
67 72 0 64 69 0
75 80 0 80 85 0
72 77 0 62 67 0
71 77 0 60 65 0
80 85 0 76 81 0
55 57 0 52 54 0
69 73 73 71 76 0
65 67 0 64 65 0
72 77 0 67 72 0
64 69 0 64 69 0
55 60 0 52 57 0
85 90 0 74 79 0
67 72 0 68 73 0
76 79 0 65 68 0
71 75 0 65 69 0
74 79 0 75 80 0
72 77 0 71 76 0
61 65 0 58 62 0
67 69 0 66 68 0
73 78 0 68 73 0
61 65 0 60 65 0
71 73 73 80 83 0
61 66 0 61 66 0
77 82 0 66 71 0
65 67 0 60 62 0
61 66 0 60 65 0
70 75 0 67 72 0
68 71 0 60 61 61
69 74 0 71 76 0
62 67 0 58 63 0
85 88 88 78 83 0
68 73 0 62 67 0
70 75 0 64 69 0
68 73 0 66 71 0
67 68 0 56 57 0
69 74 0 72 77 0
64 69 0 60 65 0
64 67 0 60 63 0
67 72 0 68 73 0
53 58 0 50 55 0
64 69 0 63 68 0
65 67 0 66 69 0
68 73 0 68 73 0
72 74 74 71 75 0
62 67 0 57 62 0
63 65 0 57 60 0
61 62 0 61 62 0
58 62 0 52 56 0
62 67 0 59 64 0
73 78 0 67 72 0
70 73 0 65 68 0
67 70 0 67 70 0
69 73 0 71 76 0
64 67 0 64 68 0
72 77 0 67 72 0
70 71 0 68 70 0
63 68 0 60 65 0
72 75 0 62 66 0
54 59 0 46 51 0
65 69 0 62 66 0
70 75 0 67 72 0
62 67 0 59 64 0
68 72 0 62 67 0
66 71 0 61 66 0
76 81 0 74 79 0
77 82 0 75 80 0
64 69 0 63 68 0
68 73 0 66 71 0
END
-------------------------------------------------------------------
This list is for discussion of modelling issues and the BUGS software.
For help with crashes and error messages, first mail [log in to unmask]
To mail the BUGS list, mail to [log in to unmask]
Before mailing, please check the archive at www.jiscmail.ac.uk/lists/bugs.html
Please do not mail attachments to the list.
To leave the BUGS list, send LEAVE BUGS to [log in to unmask]
If this fails, mail [log in to unmask], NOT the whole list
|