r - How to get the time of sampling in rjags? -


i have implemented lda model rjags. , got final samples with:

jags <- jags.model('../lda_jags.bug',                data = data,                n.chains = 1,                n.adapt = 100)  update(jags, 2000)  samples <- jags.samples(jags,          c('theta', 'phi', 'z'),          1000) 

now can use samples$theta or samples$phi result of theta , phi. how can know how long did take sample? thanks!

as @eipi10 states can use system.time() around update() call time process within r. or, can use runjags package prints (total) time taken in updating model, including previous calls extend.jags:

library('runjags') results <- run.jags('../lda_jags.bug', monitor = c('theta', 'phi', 'z'),             data = data, n.chains = 1, adapt = 100, burnin = 2000, sample = 1000) results  # or:  jags <- jags.model('../lda_jags.bug',                data = data,                n.chains = 1,                n.adapt = 0) runjags <- as.runjags(jags, monitor = c('theta', 'phi', 'z')) results <- extend.jags(runjags, adapt = 100, burnin = 2000, sample = 1000) results results <- extend.jags(runjags, sample = 1000) results 

Comments

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -