Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Calculate deviance for dinterval() in multivariate case

Help
BLi
2013-04-06
2013-04-06
  • BLi
    BLi
    2013-04-06

    Dear Jags users,

    For a dinterval() example shown below, since jags gives the wrong deviance estimate (always 1), is it correct to use pnorm function to calculate the deviance? The example:

    y[i]~dinteral(t[i],limit) # y is an ordinal variable with categories 0,1,2; limit has two values -10,10.
    t[i]~dnorm(beta0,tau)

    To calculate the deviance, we need to calculate p(t[i]<-10),p(-10<t<span>[i]<10) and p(t[i]>10). Since t[i] follows a normal distribution, we could calculate these probabilities using pnorm function in jags. Correct?

    Then what funciton should we use for a multivariate case? an example:

    y1[i]~dinterval(t[i,1],limt1)
    y2[i]~dinterval(t[i,2],limt2)
    y3[i]~dinterval(t[i,3],limt3)
    t[i,1:3]~dmnorm(beta0[],tau[,])

    In this case, how are we going to calculate all the probabilities? Is there a multivariate pnorm function, like pmvnorm in R package 'mvtnorm'?
    Any suggestions will be appreciated.

    Li