The source tarball for JAGS 4.3.0 is now available from Sourceforge. Binary distributions will be available later. See the updated manual for details of the features in the new version. This version is fully compatible with the current version of rjags on CRAN.
Fantastic!
Pingback: JAGS 4.3.0 is released | A bunch of data
Pingback: JAGS 4.3.0 is released – Mubashir Qasim
Does anyone know how to install tar file into Windows 8?
Installing from source on Windows is very difficult. Better to let us do the hard work for you and wait for the Windows binary.
Yes, I hope that it will be available soon, I need it to run for ordinal outcome, with which I try a number of parameterization but non of them works properly.
Add Like. Also waiting for this:)
It’s up now. Sorry about the delay.
Hello. What’s the best way to uninstall/remove a previous version of JAGS on macOS? I’d like to install the latter version of JAGS but according to some sources it’s better to remove the previous version of JAGS. Thank you!
Anyone?
Matt is the expert but I don’t think he will see your comments on my blog. You would be better off asking your question in the Sourceforge forum: https://sourceforge.net/p/mcmc-jags/discussion/
Thank you, Martyn.
Hi Dr Plummer, thanks very much for your work on JAGS, I have just got started using it and it is very helpful. One question though in your 4.3 user manual I can’t seem to find any section that gives a list of distributions that are supported, their functions, and the parameters they require, e.g. dnorm(0, 1e-4) I assume the second parameter is the precision or the square root of the precision but can’t seem to find which it is.
The normal distribution is covered in section 9.2.1 of the JAGS user manual which covers continuous univariate distributions in the bugs module. It might be easier to find if I add an index at the back. I’ll look into that for the next version.
Dear Martyn, Thank you so much for all your work with JAGS! I noticed that up to JAGS 4.2 in conjugate beta prior – binomial likelihood problems the “ConjugateBeta” sampler was used. I just noticed that JAGS 4.3 uses “BinomSlicer”. I wonder what motivated the change. Thank you!
That’s just a silly mistake. When I added BinomSlicer sampling method, I accidentally gave it higher precedence than the conjugate sampler. I will fix this.
Hi. I’m not sure if JAGS-4.3.0.exe found on sourceforge is meant to be used also for R 3.3.0 or later on Windows. Can you please clarify? Thank you.
Yes that is correct. R is free software and simple to upgrade, so there is no incentive for me to support JAGS on older versions of R.
Hi Martyn
Thanks for all you’ve contributed to the world through JAGS. What a tremendous public-service!
I’m writing because a relatively simple model that I’ve been running for years will not converge in JAGS 4.3. I’m particularly surprised because the troublesome parameters are slopes in a Poisson regression model, so they’re not particularly complex.
We can re-create the differences between the two JAGS versions on multiple computers (all running Windows). The same issue occurs whether running jags through the packages jagsUI or rjags.
This has happened multiple times too. The model that was run is pasted below. The data are counts of birds along survey routes that are conducted annually. You can access the data and the models through the R package bbsBayes (see https://github.com/BrandonEdwards/bbsBayes). In that package this model is called “slope”. This package is used to generate annual indices of abundance for species of North American birds. bbsBayes is a wrapper package for the JAGS data preparation and MCMC modelling used by the United States Geological Survey and Canadian Wildlife Service for their annual reports. It uses the jagsUI package to run the JAGS models.
So, what might be causing this difference? Is it the samplers?
Jags 4.3 version of the models run through rjags: FAILS TO CONVERGE. Here’s the list of samplers:
#list.factories(“sampler”)
factory status
1 glm::Holmes-Held TRUE
2 glm::Generic TRUE
3 glm::ScaledWishart TRUE
4 glm::ScaledGamma TRUE
5 bugs::BinomSlice TRUE
6 bugs::RW1 TRUE
7 bugs::Censored TRUE
8 bugs::Sum TRUE
9 bugs::DSum TRUE
10 bugs::Conjugate TRUE
11 bugs::Dirichlet TRUE
12 bugs::MNormal TRUE
13 base::Finite TRUE
14 base::Slice TRUE
And the jags 4.2 version of the exact same model and code: CONVERGES WELL. Here’s the list of samplers after running the model.
jags 4.2 result of
list.factories(“sampler”)
factory status
1 glm::Albert-Chib TRUE
2 glm::Albert-Chib-Gibbs TRUE
3 glm::Auxiliary-Mixture TRUE
4 glm::Linear TRUE
5 glm::LinearGibbs TRUE
6 glm::IWLS TRUE
7 bugs::Censored TRUE
8 bugs::Sum TRUE
9 bugs::DSum TRUE
10 bugs::Conjugate TRUE
11 bugs::Dirichlet TRUE
12 bugs::MNormal TRUE
13 base::Finite TRUE
14 base::Slice TRUE
Here’s the model. It includes many derived parameters that aren’t important here, but the key parameters that are failing to converge in JAGS 4.3 are “beta[]” (random-effect slopes) and “BETA” (fixed-effect, hyperparmeter for the mean of the beta[]s). The data are counts (count[]) of birds along annual survey-routes,
model
{
#### counts and overdispersion effects ###### Link-Sauer model with nested observer-route effect
for( k in 1 : ncounts )
{
likelihood
}
Thank you so much for any help you can provide.
That doesn’t sound good. It would help a lot if you could send me an R script that would allow me to run the model and collect samples after loading the package and downloading the data.
Thank You Martyn:
Here’s a short script that will allow you to run the model using the sample data that come with the package installation. If you run it with JAGS 4.2 and 4.3, you’ll see the different convergence.
Run this script once using JAGS 4.3.0 and once using
JAGS 4.2.0 and compare the differences in the R hat values
Install latest bbsBayes release, attach package:
install.packages(“devtools”)
library(devtools)
devtools::install_github(“BrandonEdwards/bbsBayes”, ref = “v1.1.0”)
library(bbsBayes)
Stratify the sample data that comes with the package
strat_data <- stratify(by = “bbs_cws”, sample_data = T)
Prepare stratified data for JAGS using slope model
jags_data <- prepare_jags_data(strat_data = strat_data,
species_to_run = “Wood Thrush”,
model = “slope”)
Run JAGS Model
This will take a while. If you have the capability to run
parallel chains on your computer, change the last argument to
‘parallel = TRUE’
to use 3 cores with 1 chain per core.
mod <- run_model(jags_data = jags_data,
parameters_to_save = c(“BETA”, “beta”),
parallel = FALSE)
View data frame of r hat values for BETA and beta parameters
rhat <- r_hat(mod,
parameter_list = c(“BETA”, “beta”))
Hi Martyn
Have you had a chance to investigate this? Can I help in any other way?
Thanks again
Adam
Yes I did. The sampler factories in the glm module can give up under certain circumstances, which are triggered by your example. So you are not getting the advantages of the advanced sampling methods for glms. I had tried to fix this in the development version but the compiler grinds to a halt instead, which I spent some time fixing.
This appears to be an unintended consequence of you using a centred parameterization for the random effects. You could try using a non-centered parameterization to see if that works.
It’s difficult to make progress debugging this example because it is so huge.
Ok. Thanks Martyn. I’ll try an alternate parameterization of the random effects.
Hi Again Martyn
I’ve created a non-centered version of the model. But now the model fails to initialize in 4.3.
I’ve placed a simplified version of the model, a subset of the data, and a test example script, in a GitHub repository: https://github.com/AdamCSmithCWS/JAGS-version-compare
In the script, it’s only the initialization step that I’ve tested, since that seems to be the source of the problem. It will also hopefully be a bit easier to re-create because the dataset is much reduced (a full model-run of ~20000 iterations only required ~30 minutes in JAGS 4.2).
You can ignore this issue. The most recent update to rjags (4-10, posted Nov 6, 2019) seems to have solved it.
Thanks for your help.
Hi Martyn,
I have a model that was written in OpenBugs, where one of the parameters is declared as follows:
K~dlnorm(11.52,1)I(100000,6000000)
When running in Jags, I get a compile error on this line with the message: BUGS I(,) notation is only allowed if all parameters are fixed.
The model works fine in OpenBugs. However, I would like to move the model over to Jags. I am wondering if Jags would declare this parameter differently.
With thanks,
Divya
Hi Divya,
Just replace the “I” with a “T” in JAGS.
K ~ dlnorm(11.52, 1) T(100000, 6000000)
Normally this example should work in JAGS since all parameters of dlnorm are, in fact, fixed.
Thank you Martyn. I will try to implement this way.