Sunday 15 July 2012

r - Index out of range GraphCat.Parent OpenBUGS -


I am trying to implement a FHM in R and Openbugs, but now I'm stuck at the following error.

In the first openbug me just after changing the Trophandor.OCF name of the Traffandor_Smpl.OCF, gave "something went wrong", I was able to see that graphicat had an "index of range" error . However, I was unable to detect the offensive piece of code (knowing nothing about Fortran and nothing about MCMC)

The structure of FHM was making me try to create M = 3 sub Series, N] where m = 1,2,3 and n = 1, ..., 100 in my code), each sub-series has K = 2 states, and Emissions is a linear Gaussian emission of 3 series < / P>

This is my model,

  # m = 3, k = 2, n = 100 models & lt; - Function () {for (m: 1: m) {s [m, 1] ~ decat (p [m, 1: k]) are the preliminary states of each sub-chain (1: M in M) {k For (i in 2: n) {s [m, i] ~ dcat (trans [s [m, i-1], 1: k, m]] # dim (trans) c (2, 2, 3)} } (1: M in M) {for (i 1: n) {mu [m, ii] & lt; - mu [m, s [m, i]] sigma [m, i] & lt; - 1 / Tau [M, S [M, I]]}} (I: 1: N) {mm [i] & lt; - sum (mu0 [1: m, i]) tt [i] & lt; - 1 / sum (for sigma [1: m, ii]) i [i] ~ dnorm (mm [i], tt [i])}}  

And likewise, I set initial values ​​and data in R,

  # initial value S (I: 1: M) {sB [i,]  

It seems that Openbuzz was trying to sample [1,2], but I do not think what it means is that the slightly related clues (Stackoverflow I do not allow screen capturing until I have 10 reputable ...)


No comments:

Post a Comment