Print

Print



hello
i'm sorry to bother you. i wrote a code in winbugs. this code comes from an paper's data and i want to compare my answers with that. in stats option didn't have problem and the results were close. but when i want to calculate DIC it was far from the paper's (i sholud notify that my data is same as paper data). for example the Dbar in paper is 131 and mine is -31!!! i don't understand where is the problem! for checking the other's DICs i downloaded a code from the internet and again the dic was negative with the same range!! can you help me? here is my code. can you say were is the problem? is my code incorrect or there is somthing wrong with my winbugs application?
model 
{       
#likelihood
for(i in 1 : N) {
ROP [i] ~ dnorm(mu [i], tau) 
mu [i] <- a1 * UCS [i] + a2 * BI [i] + a3 * pow(DPW [i] , a4) + a5 * pow( alpha [i] , a6) +a7
}           
# priors:
    tau ~ dgamma(0.000001,0.000001)
    sigma <-1/sqrt(tau)
a1 ~ dnorm(0.0,1.0E-6)            
a2 ~ dnorm(0.0,1.0E-6)            
a3 ~ dnorm(0.0,1.0E-6)           
a4 ~ dnorm(0.0,1.0E-6)            
a5 ~ dnorm(0.0,1.0E-6)            
a6 ~ dnorm(0.0,1.0E-6)
a7 ~ dnorm(0.0,1.0E-6)
        
}
list(N=121, ROP = c( 2.19, 2.12, 1.88, 2.81, 2.2, 2.37, 2.34, 2.9, 3.04, 3.07, 3.04, 2.95, 2.66, 2.3, 2.17, 2.87, 2.48, 2.02, 1.87, 2, 2.45, 2.18, 2.17, 2.09, 2.1, 2.05, 2.6, 2.46, 2.2, 2.14, 2.78, 2.03, 2.05, 2.47, 2.05, 2.47, 1.83, 2.08, 1.87, 2.1, 2.31, 2.43, 1.79, 2.17, 2.17, 1.65, 1.75, 1.87, 1.78, 1.78, 2.39, 1.28, 1.85, 2.2, 2.43, 2.13, 1.71, 2.04, 2.39, 2.14, 1.88, 1.88, 1.27, 2.14, 1.77, 2.14, 1.6, 2.05, 2.44, 2.42, 1.67, 2.12, 2.17, 2.28, 2.12, 2.47, 2, 1.5, 2.47, 2.35, 2.07, 2.28, 2.16, 2.61, 1.91, 2.26, 1.85, 1.58, 1.51, 2.36, 1.82, 1.5, 2.05, 1.84, 1.38, 1.96, 1.85, 1.95, 1.6, 1.88, 1.88, 2.11, 1.64, 1.51, 2.17, 2.16, 1.98, 2.09, 1.77, 2, 1.84, 2.15, 1.7, 1.46, 2.23, 1.87, 1.82, 2.64, 1.94, 1.97, 2.01
),
       UCS =   c( 199.7, 199.3, 199, 189.7, 189, 168.3, 174.1, 177.9, 180.7, 184.1, 192.4, 191, 191, 194.5, 195.2, 188.3, 188.4, 193.1, 182.8, 182.4, 182.4, 192.7, 192.6, 164.1, 160.7, 160.7, 144.8, 140, 137.2, 136.6, 135.2, 136.2, 137, 137.4, 137, 137.4, 139.3, 139.4, 141, 140.7, 139.7, 138.9, 136.5, 134.2, 131.4, 130, 128.6, 130, 131, 131, 129, 130, 130.1, 130.2, 138.6, 138.8, 138.8, 138.7, 138.6, 137.4, 137.2, 136.2, 135.2, 134.8, 134.1, 133.3, 133.4, 134.1, 134.3, 134.3, 134.3, 133.9, 133.8, 143.4, 145.4, 146.2, 145.9, 137.5, 140.7, 145.5, 158.6, 159, 159.3, 159.3, 160.3, 159.6, 153.8, 154.5, 157.9, 160.3, 163.2, 164.3, 166.4, 173.1, 173.1, 174.1, 174.5, 175.2, 176, 176.8, 176.8, 177, 175.9, 175.2, 173.1, 156.9, 150.7, 147.6, 147, 145.6, 144.8, 140.7, 125.5, 123.1, 122.3, 121.7, 121.7, 121.7, 120.7, 119.7, 118.3
),


       BI=  c( 55, 55, 55, 56, 56, 58, 58, 58, 57, 57, 54, 54, 53, 52, 52, 46, 45, 43, 39, 39, 39, 42, 42, 46, 46, 46, 42, 43, 42, 41, 41, 40, 39, 39, 39, 39, 38, 38, 38, 38, 37, 37, 35, 34, 34, 34, 32, 32, 32, 32, 31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 32, 32, 32, 33, 33, 33, 33, 34, 35, 35, 36, 36, 38, 37, 36, 36, 36, 35, 36, 35, 33, 33, 32, 32, 32, 30, 31, 31, 31, 31, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 29, 29, 29, 28, 29, 29, 29, 29, 30, 30, 29, 29, 29
),  
        DPW  =  c( 0.8, 1.6, 2, 0.2, 2, 1.6, 2, 0.4, 0.2, 0.4, 0.4, 0.4, 0.1, 0.4, 0.4, 0.2, 0.2, 0.8, 0.8, 0.8, 0.4, 0.4, 0.2, 0.8, 1.6, 1.6, 0.2, 0.1, 1.6, 0.8, 0.4, 0.4, 1.6, 0.8, 1.6, 0.8, 2, 2, 1.6, 1.6, 1.6, 0.8, 1.6, 2, 2, 1.6, 1.6, 1.6, 0.4, 0.4, 0.8, 0.8, 0.8, 0.8, 0.4, 0.8, 0.4, 0.8, 0.2, 1.6, 0.8, 0.4, 1.6, 0.4, 1.6, 0.8, 1.6, 0.8, 0.4, 0.4, 1.6, 0.4, 0.4, 1.6, 1.6, 0.4, 0.8, 1.6, 0.1, 0.8, 0.1, 0.2, 0.8, 0.8, 0.8, 0.4, 0.8, 2, 1.6, 0.1, 0.8, 0.4, 0.4, 0.8, 0.8, 0.8, 0.1, 0.4, 2, 1.6, 1.6, 0.4, 2, 2, 1.6, 0.8, 1.6, 2, 2, 1.6, 2, 1.6, 2, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.2, 0.8
), 

        alpha  =  c( 25, 21, 20, 42, 40, 41, 35, 61, 55, 49, 32, 34, 23, 33, 30, 29, 24, 41, 20, 66, 55, 55, 59, 19, 66, 31, 67, 46, 70, 62, 29, 32, 21, 46, 21, 46, 41, 40, 10, 28, 36, 47, 14, 41, 44, 15, 10, 15, 2, 11, 39, 2, 26, 32, 58, 55, 8, 17, 50, 69, 67, 45, 7, 62, 76, 47, 18, 19, 30, 40, 4, 81, 60, 33, 71, 32, 61, 10, 15, 52, 36, 74, 35, 78, 26, 20, 52, 52, 10, 70, 21, 4, 74, 33, 11, 37, 4, 56, 71, 88, 77, 89, 66, 79, 63, 51, 81, 44, 86, 72, 70, 68, 70, 10, 57, 36, 56, 80, 68, 60, 71
))


list(a7 = 0, a1= 0, a2 = 0, a3 = 0, 
    a4 = 0, a5= 0.1, a6 = 0, tau=0.000001)


------------------------------------------------------------------- This list is for BUGS users to support each other, ask questions or share ideas. 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