Guest User

Untitled

a guest
Jan 23rd, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. model{
  2. #Likelihood
  3. for( i in 1 : N) {<br/>
  4. Disease[i] ~ dbern (thetacombine[i])<br/>
  5. thetacombine[i]<-theta1new[i]*theta0new[i]<br/>
  6. theta1new[i]<-pow((theta1[i]+0.0000000001),G[i])<br/>
  7. theta0new[i]<-pow((theta0[i]+0.0000000001),(G[i]-1))<br/>
  8. }
  9. #Priors regressors <br/>
  10. theta1 ~ dbeta (a1,b1)<br/>
  11. theta0 ~ dbeta (a2,b2)<br/>
  12. }
  13.  
  14. bayes_data <- list(
  15. Disease = Disease,
  16. G = G,
  17. N = ntot,
  18. a1=5,
  19. b1=1,
  20. a2=1,
  21. b2=3
  22. )
  23.  
  24. bayes_posterior_jags <- jags.model(
  25. file = bayes_model_str,
  26. data = bayes_data,
  27. inits = bayes_init,
  28. n.chains = 3,
  29. n.adapt = 100
  30. )<br/>
Add Comment
Please, Sign In to add comment