Jags/R had practically two problems with this line:
out <- jags.parallel(win.data, inits, params, "Poisson.OD.t.test.txt",
nc, ni, nb, nt);
Both are related to evaluation of function parameters - he is probably not able to resolve parameters which refer to other R variables:
1) The win.data
was encoded as variable names as usually for WinBUGS/Jags:
win.data <- list(C.OD = C.OD, x = as.numeric(x)-1, n = length(x))`
but jags.parallel
issues the error "Error in get(name, envir = envir) : invalid first argument". He wants the data in this format:
windata <- list("C.OD", "x", "n")
Why? Don't ask me... I discovered this when reading the example of ?jags
.
2) The arguments nc, ni, nb, nt
in function call are a problem! If I put constants, it is OK, but references to variables are unacceptable for him. Don't ask me why. Remedy found at strange jags.parallel error / avoiding lazy evaluation in function call.
The complete fix looks like:
out <- do.call(jags.parallel, list(names(win.data), inits, params, "Poisson.OD.t.test.txt",
nc, ni, nb, nt));