Error in node T Invalid parent values: rjags dwsh distribution

35 views Asked by At

I am fitting a bayesian joint model of longitudinal data analysis. below is part of the code where am getting an error on the precision matrix of dwish distribution. please am requesting help on how to solve the error message.

 mod<-"model {
  T[1:8,1:8]~dwish(R[1:8,1:8],9)
    }"


 Rinv<-matrix(c(0.13,0.04,0.01,0.01,0.03,0.02,-0.03,0.01,
            0.04,0.36,-0.17,0.24,0.01,0.10,0.00,0.02,
            0.01,-0.17,0.49,-0.40,0.01,-0.03,0.11,-0.02,
            0.01,0.24,-0.40,0.86,0.01,0.10,-0.15,0.26,
            0.03,0.01,0.01,0.01,0.01,0.00,0.00,-0.01,
            0.01,0.01,-0.03,0.10,0.00,0.10,-0.06,0.16,
            -0.03,0.00,0.11,-0.15,0.00,-0.06,0.16,-0.20,
            0.01,0.02,-0.02,0.26,-0.01,0.16,-0.20,0.61),
          nrow = 8,ncol = 8)
#R_inv<-diag(1,8)
mdl <- jags.model(textConnection(mod), data=list("R"=Rinv))
jags.samples(mdl, 100000, variable.names="T")

When i use the identity matrix it works but then i would like to use the variance-covariance matrix.

0

There are 0 answers