#28 problem with jags.samples

v1.0_(example)
closed
nobody
1
2013-05-14
2013-05-13
Arnaud
No

The function jags.samples do not extract the deviance required when the function is call from a cluster (see example code below executed from a R 64 bits).
The error seems to appears when the function call the C code
status <- .Call("set_monitors", model$ptr(), pn$names, pn$lower, pn$upper, as.integer(thin), type, PACKAGE = "rjags")

The jags.samples function do the same thing if you execute the function from R 32 bits, so I suppose the C call used when called by one of the worker of the cluster is the 32 bits version ... but I don't know why !

Hope you can correct that !

Arnaud

~~~~~~~~~~~~~~~~~~~~~

data(LINE)
LINE$recompile()
print(jags.samples(LINE, c("alpha", "deviance"), n.iter=10))

Parallel version

cl <- makeCluster(2)
clusterSetRNGStream(cl, 123)
junk <- clusterEvalQ(cl, library(rjags))
clusterEvalQ(cl, test <- function() {
library(rjags)
data(LINE)
LINE$recompile()
print(jags.samples(LINE, c("alpha", "deviance"), n.iter=10))})

clusterEvalQ(cl, test())
~~~~~~~~~~~~~~~~~~~~

Related

Bug reports: #28

Discussion

  • Martyn Plummer
    Martyn Plummer
    2013-05-14

    You need to load the "dic" module to monitor the deviance.

     
  • Arnaud
    Arnaud
    2013-05-14

    Thanks for this quick answer.
    It corrects my "problem".

    Have a good day !

    Arnaud

    2013/5/14 Martyn Plummer martyn_plummer@users.sf.net

    You need to load the "dic" module to monitor the deviance.

    Status: open
    Labels: jags.samples 32 bits 64 bits
    Created: Mon May 13, 2013 08:09 PM UTC by Arnaud
    Last Updated: Mon May 13, 2013 08:09 PM UTC
    Owner: nobody

    The function jags.samples do not extract the deviance required when the
    function is call from a cluster (see example code below executed from a R
    64 bits).
    The error seems to appears when the function call the C code
    status <- .Call("set_monitors", model$ptr(), pn$names, pn$lower, pn$upper,
    as.integer(thin), type, PACKAGE = "rjags")

    The jags.samples function do the same thing if you execute the function
    from R 32 bits, so I suppose the C call used when called by one of the
    worker of the cluster is the 32 bits version ... but I don't know why !

    Hope you can correct that !

    Arnaud

    data(LINE)
    LINE$recompile()
    print(jags.samples(LINE, c("alpha", "deviance"), n.iter=10))

    Parallel version

    cl <- makeCluster(2)
    clusterSetRNGStream(cl, 123)
    junk <- clusterEvalQ(cl, library(rjags))
    clusterEvalQ(cl, test <- function() {
    library(rjags)
    data(LINE)
    LINE$recompile()
    print(jags.samples(LINE, c("alpha", "deviance"), n.iter=10))})

    clusterEvalQ(cl, test())


    Sent from sourceforge.net because you indicated interest in
    https://sourceforge.net/p/mcmc-jags/bugs/28/

    To unsubscribe from further messages, please visit
    https://sourceforge.net/auth/subscriptions/

     

    Related

    Bug reports: #28

  • Martyn Plummer
    Martyn Plummer
    2013-05-14

    • status: open --> closed
     
  • Arnaud
    Arnaud
    2013-05-14

    Ok, I will try that.

    But why is it automatic in jags.samples for 64 bits version and not in the
    32 bits version ?

    2013/5/14 Martyn Plummer martyn_plummer@users.sf.net

    You need to load the "dic" module to monitor the deviance.

    Status: open
    Labels: jags.samples 32 bits 64 bits
    Created: Mon May 13, 2013 08:09 PM UTC by Arnaud
    Last Updated: Mon May 13, 2013 08:09 PM UTC
    Owner: nobody

    The function jags.samples do not extract the deviance required when the
    function is call from a cluster (see example code below executed from a R
    64 bits).
    The error seems to appears when the function call the C code
    status <- .Call("set_monitors", model$ptr(), pn$names, pn$lower, pn$upper,
    as.integer(thin), type, PACKAGE = "rjags")

    The jags.samples function do the same thing if you execute the function
    from R 32 bits, so I suppose the C call used when called by one of the
    worker of the cluster is the 32 bits version ... but I don't know why !

    Hope you can correct that !

    Arnaud

    data(LINE)
    LINE$recompile()
    print(jags.samples(LINE, c("alpha", "deviance"), n.iter=10))

    Parallel version

    cl <- makeCluster(2)
    clusterSetRNGStream(cl, 123)
    junk <- clusterEvalQ(cl, library(rjags))
    clusterEvalQ(cl, test <- function() {
    library(rjags)
    data(LINE)
    LINE$recompile()
    print(jags.samples(LINE, c("alpha", "deviance"), n.iter=10))})

    clusterEvalQ(cl, test())


    Sent from sourceforge.net because you indicated interest in
    https://sourceforge.net/p/mcmc-jags/bugs/28/

    To unsubscribe from further messages, please visit
    https://sourceforge.net/auth/subscriptions/

     

    Related

    Bug reports: #28


Anonymous


Cancel   Add attachments





Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks