Copula is JAGS

Help
Arnaud
2013-10-23
2013-11-14
  • Arnaud
    Arnaud
    2013-10-23

    Hi,

    I want to transpose a model written in R into a JAGS model, however, in one part of this model I use the function copula to obtain a correlation between several binomial distributions.
    Is there a way to reproduce that in JAGS ?

    Thanks,

    Arnaud

     
    • Martyn Plummer
      Martyn Plummer
      2013-10-24

      Well, there are lots of different copulas. Which one are you using?

       
      • Arnaud
        Arnaud
        2013-11-14

        Hi Martyn,

        Sorry for the delay for my answer.
        Currently, I use normal copula to sample into correlated binomial distributions using a code similar to the following example.

        require(copula)
        probAndSize <- matrix(c(0.8,0.6,0.3,0.2,50,20,30,10), byrow=F, ncol=2)
        correl <- 0.8
        norm.cop <- normalCopula(correl, dim=4)
        rcop <- rCopula(1, norm.cop)
        out <- sapply(seq(1,4), FUN = function(x){qbinom(rcop[,x], prob = probAndSize[x,1], size=probAndSize[x,2])/probAndSize[x,2]})
        

        So, if I transpose that into a Bayesian model, I need a way to define correlations between several binomial distributions.

        Arnaud

         
  • Arnaud
    Arnaud
    2013-11-14

     
    Last edit: Arnaud 2013-11-14