c2d4u and RRutter Ubuntu PPA Updates

| 0 Comments | 0 TrackBacks

On January 27, 2014 Raring Ringtail (13.04) reached end of life. I have been slowly removing the Raring repositories from the RRutter PPA, c2d4u PPA, and CRAN. I think I have most of that cleaned up, so there is no longer support for R in Raring from my sites.

In April, Trusty Tahr will be releases. This is Ubuntu 14.04 and a LTS. I have already added Trusty to the RRutter PPA and c2d4u PPA. Once Trusty is officially released, I will also make it available on CRAN. Initially, all the packages on c2d4u are copied from Precise. This saves building 2000+ packages on the PPA. New and updated packages will be built for Trusty and Precise, with the Saucy packages copied from Precise.

Since Ubuntu has moved to the shorter life span model for non-LTS releases, this will be my approach. Base R and the recommended packages (the RRutter PPA) will be built against each release, but on c2d4u I will only be building pacakges for the last two LTS releases. Any non-LTS releases on c2d4u will consists of packages copied from the a previous LTS. This may create some strange naming conventions for the packages on c2d4u, but most users will never notice. If something does not work, please let me know.

Finally, I have been playing around with the download stats available from PPA via the Launchpad API. As of noon on March 14 (Happy Pi Day!), here are the download numbers for the "r-base" (version 3.0.3) package:

  • Precise: 302
  • Saucy: 143
  • Lucid: 10
  • Quantal: 9
  • Trusty: 4

Cran2deb4ubuntu: An Update for 2014

| 0 Comments | 0 TrackBacks

I have been a little quiet on the update front for the past few months, so I thought I would give a quick update as 2014 begins. Between increased responsibilities at work (pseudo-department chair) and some family health issues, work on cran2deb4ubuntu (c2d4u) slowed a bit in the last half of 2013. Here is the current state of cran2deb4ubuntu.

Precise and Raring continue to be updated

During the last half of 2013, Precise and Raring have been updated on more or less a weekly basis. In fact, additional packages from the CRAN Task Views have been added, bringing the total number of R packages available now exceeding 2000.

Quantal has been removed from c2d4u

Although Quantal (12.10) is still supported officially until April, I have a policy of maintaining only three releases on c2d4u. Space is a big issue, as well as trying to deal with build issues for 2000+ packages on four releases. I will always keep the latest LTS (currently Precise) and the latest two releases updated and available. With the release of Saucy, it was Quantal's time to go. Base R packages will still be released for Quantal on CRAN and the RRutter PPA.

Saucy has been added to c2d4u

This took a while. With the move to shorter support schedules (Saucy will only be supported until July 2014), I was hesitant to put the time into building 2000+ plus packages for a release with a life span of only 9 months. However, I have recently spent some time with the Python interface to the Lauchpad API, and have created a series of scripts that allow me to copy 95% of the packages from one release to another. And that is how I created the Saucy c2d4u packages.

One problem with copying packages is that the have the same file name as the original packages. Therefore, 95% of the packages in the Saucy c2d4u PPA have "raring" in the file name. They still work in Saucy, and the only way you would notice is this if you closely watch apt output or the results of a synaptic search. As long as you keep your version of R current, I don't see any reason why these "copied" packages will not work. If there is an issue, please let me know.

Changes going forward

I still plan on supporting only three Ubuntu releases at a time on c2d4u. However, to save myself and Launchpad time and effort, I will only be building packages for the latest LTS (currently Precise). Any other supported releases (Raring and Saucy) will now have the packages copied from the latest LTS to that release. To help with this, I will be eliminating the release name in the package build. For example, "lme4 - 1.0-5-1cran1precise0 " will become "lme4 - 1.0-5-1cran1ppa0". If the package was rebuilt especially for a non-LTS release, I will add the release name to the build.

If anyone discovers a copied package that does not work, let me know and I will add the package to a list to be built, not copied. This move should also allow for frequent and timely updates.

Honestly, with the move to shorter support cycles, I think a majority of R users who use Ubuntu will stick to the LTS releases. Therefore, I will concentrate my effort on those releases. The non-LTS releases will still be supported, but with the "copy" vs. "build" approach, I think the workload on my end will be more manageable.

OpenBLAS is a multi-threaded BLAS library that has been available in Ubuntu for a while, minus the multi-threading. This has been fixed for the OpenBLAS package to be released in Saucy Salamander, and I have backported the package to the more recent releases of Ubunutu, including Raring, Quantal, and Precise. The current version of OpenBLAS is 0.2.8-1.

To install the multi-threaded version of OpenBLAS, install my RDev PPA. Then run the following:

 sudo apt-get update
 sudo apt-get install libopenblas-base

If you are using Precise (12.04) or Quantal (12.10), you will need to install more recent version of atlas and/or blas, which are also available on the RDev PPA. You will notice a warning about breaking older versions of atlas and blas, which is an indication that you will need to install the other packages.

The good news is that once you install the package, there is nothing you need to do to enable the library. It should also use the maximum number of cores available on your machine, up to 64 (hard limit coded into the package).

To test the library, run R-benchmark-25.R before you install the package and then after. Watch the number of cores being used (via htop, for example) with and without OpenBLAS. With OpenBLAS you should see all you cores ramp up to 100% when doing some of the benchmarks. The decrease in time to run the benchmark will vary from machine to machine. To remove the library, just remove the package.

If you have any questions or problems, please let me know.

cran2deb4ubuntu Updated for R 3.0.1 and Ubuntu 13.04

| 0 Comments | 0 TrackBacks

It has taken a long time, but cran2deb4ubuntu has been updated for R 3.0.1. Over 1000 R packages are available as .deb files (with dependicies) for Ubutnu 13.04 (raring), 12.10 (quantal) and 12.04 (precise).

These packages can be found at the c2d4u PPA. Instructions on how to install the PPA can be found on this webpage.

Hopefully, I have updated every package. If one has slipped through the cracks, please let me know via mail (marutter@gmail.com). The package list is based on the the CRAN Task Views, so if a package you use is missing, the best way to get it into c2d4u is to get it added to an appropiate Task View.

Backporting R 3.0.0 to Quantal, Precise, and Lucid

| 0 Comments | 0 TrackBacks

Today (May 4, 2013) I will begin the process of backporting R 3.0.0 to Quantal, Precise, and Lucid. This will include all the recommended packages and the packages for R found in the universe repository for Ubuntu. Things to keep in mind:

  • If you do not want to receive these upgrades and you use the CRAN repositories or my Launchpad PPA, please remove them from your apt/synaptic sources lists. This will keep you on your current versions.

  • You could pin the old versions (search google for "apt pinning"), but since updates will only be coming for R 3.0.0, it is easier to just remove the repositories.

  • This should be complete by Monday, but it may take longer depending on server load.

After the update process, base R and the recommended packages will be found on CRAN while all the other packages can be found at my PPA.

R 3.0.0 and Raring Ringtail (Ubuntu 13.04)

| 0 Comments | 0 TrackBacks

New .deb packages for R 3.0.0 on Raring Ringtail (13.04) are available on both CRAN and my Launchpad PPA. Some notes for this release.

  • The initial build for Raring Ringtail did not come with Tcl/Tk being supported. This issue has been addressed and the current release supports Tcl/Tk.

  • Due to a small configuration error on my server, the amd64 packages for Raring Ringtail did not sync to CRAN. This has been fixed and the 64-bit packages should be available soon on a CRAN mirror near you.

  • As has been previously discussed, R 3.0.0 requires that all packages be rebuilt against it. Therefore, all the r-cran-* packages found in the Ubuntu universe repository will not work with R 3.0.0. In an effort to rectify this, I have rebuilt a number of those packages against R 3.0.0 and they can be found at the RRutter PPA, but not CRAN. I am still having issues with a couple of packages, but I am working on those.

  • R 3.0.0 is still available for older Ubuntu releases on my RDev PPA. The plan is to upgrade Lucid, Precise, and Quantal this Friday evening (May 3rd, 2013) as well as many of the r-cran-* packages available in universe. If you do not want to upgrade to R 3.0.0, please remove the appropriate repository from you sources list.

Moving to R 3.0.0 on Ubuntu

| 0 Comments | 0 TrackBacks

As you may (or may not) be aware of, R 3.0.0 is scheduled to be released on April 3rd. Since this is a major release and there may be some growing pains (but I hope not) in the move 3.0.0, here is some information about how I will handle R 3.0.0 on CRAN and my PPAs for Ubuntu.

All packages must be rebuilt for R 3.0.0

Any installed packages you are currently using will have to be rebuilt using R 3.0.0. This could lead to some issues, especially is you are using the Ubuntu binaries on CRAN or my PPA. I will try to minimize these issues.

CRAN and RRutter PPA are now frozen to R 2.15.3 (with one exception)

Since many users would probably be alarmed to have production machines upgrade to R 3.0.0 without testing to see if any thing breaks, the packages on CRAN and the RRutter PPA will not be updated anymore. This means R is frozen with version 2.15.3 and the packages available will not be updated on CRAN or the RRutter PPA for now.

At some point, likely around May 1st, I will move CRAN and the RRutter PPA to version 3.0.0. This should give users plenty of time to remove those repositories from apt so the upgrades do not occur. I will warn everyone when I am about to do this.

The one exception to this rule will be the forth coming Ubuntu 13.04 (Raring Ringtail). When I add this release to CRAN and the PPA, I will be using R 3.0.0 and packages built against 3.0.0.

R 3.0.0 and recommended packages will be available on RDev PPA

If you do want to upgrade R to 3.0.0, you can use my RDdev PPA. This will have the latest version of R and the recommended packages built against it. Instructions on how to install the PPA are available at the RDdev PPA webpage. As of right now, only 12.10 (quantal) builds are available, but others will be added when bugs are worked out. Please, do not have the RDev PPA and (CRAN or RRutter PPA) enabled at the same time, as that could cause issues.

What about c2d4u?

Excellent question.

Stopping support for Hardy and Oneiric

Both Hardy (8.04) and Oneiric (11.10) are ending support in April 2013. Therefore, I will not be updating any version of R for these releases. I, for one, am happy to finally be able to rid myself of the albatross (or should I say heron) that is Hardy. I will not delete these files for a while, but there will be no further updates. Support for Lucid (10.04) will continue until April 2015 or until something becomes very broken.

Are you sure you don't have anything to say about c2d4u?

c2d4u is an ambitious project that houses over 1000 packages for R as Ubuntu binaries that can be installed via apt or synaptic. You should really check it out. It has great packages like RCpp and ggplot2, among others.

My first priority will be is to build all the packages for Ubuntu 13.04 (Raring Ringtail) using R 3.0.0. After that is complete, I will start rebuilding the packages for 12.04 (Precise), the latest LTS, against 3.0.0. If I still have any patience left, I will convert the 12.10 (Quantal) packages over.

If you have any questions, please email me. My contact information can be found above.

R 2.15.3 .deb packages now available for Ubuntu

| 0 Comments | 0 TrackBacks

The latest version of R (2.15.3) is now available for Ubuntu. You can find the packages on CRAN or via my Launchpad PPA.

Just before the release of 2.15.3, a patch for "r-base" was released dealing with MD5 sums in the package the caused some problems on Quantal, but those have been resolved.

Also, a change in the version of "libtiff-dev" dependency caused some delays in the versions of "r-base" for Ubuntu releases prior to Quantal from building. Those issues have been resolved as well and the 2.15.3 is or will soon be available on the CRAN mirrors.

If there are any issues, please feel free to contact me.

rjags Updated and Numbering Corrected

| 0 Comments | 0 TrackBacks

On September 18th, Martyn Plummer updated rjags. Normally, this wouldn't be a big deal, but a question came across the R-sig-debian mailing list about the package at the same time, and I noticed that my Ubuntu 12.04 (precise) machine was using version 3.3 from the Ubuntu universe repository and not the 3.5 version that is available at the RRutter or c2d4u PPAs.

Turns out the version numbering system used by Martyn is not compatible with the Ubuntu numbering system used for the package in the universe repository. The universe package is numbered "3.3" while Matryn's numbering format uses all dashes, "3-5". The debian version of the package has not been updated since 3.3, so the source package used to create my update was genereated via the cran2deb4ubuntu project and kept Martyn's "-" version numbering.

Even though rjags 3-5 was available in the PPA, rjags 3.3 was considered a more recent version by Ubuntu and the package was never upgraded. It is possible to use apt pinning or synaptic to force the "newer" version, but I have correct the numbering issue and the newest version of r-cran-jags is numbered "3.7" and will update automatically.

Not sure if any other packages on c2d4u have similar issues. If anybody spots one, please let me know.

Comparing Stan to JAGS for Bayesian Inference (Part 1?)

| 0 Comments | 0 TrackBacks

Stan is a new, open source, Bayesian inference tool. Stan is based on the the No-U-Turn sampler, a variant of Hamiltonian Monte Carlo. In order to compare Stan with JAGS, a gibbs sampler approach to Bayesian inference, I used the classic WinBUGS rats example. The rats example uses a hierarchical model to look at the growth curves of 30 rats.

In this example, I used R with RStan and R2jags packages. I used the code on the RStan Getting Started and the examples from the JAGS sourceforge page as starting points. I used a very large number of samples to test run times. Data and model files needed are below.

rats.csv

rats.bug

rats.txt

rats.stan

Both RStan and R2jags use the same list structure for the model data. In in R2jags, you need to specify which variables you wish to monitor, while RStan defaults to all of the variables. Both require an external model file and have very similar commands to fit the model. So, within R, both packages are very similar.

When you run the code, you will note that JAGS starts the sampling immediately, while Stan requires a lengthy compilation step. You will also see that I used two different calls to "stan".

  stan.fit <- stan(file = 'rats.stan', data = rats_dat, verbose = FALSE,
             warmup=1000,iter = 11000, n_chains = 3)
  stan.fit2 <- stan(fit=stan.fit, data = rats_dat, verbose = FALSE,
              warmup=1000,iter = 11000, n_chains = 3)

The first compiles the model and runs the sampler, while the second uses the model from the first command. This eliminates the need to recompile the model, saving a good chunk of time. Notice the first argument has changed from "file=" to "fit=". I also discovered that adding the "thin" option to either "stan" call creates a segfault, which I have reported the the Stan maintainers.

The answers that each program produced were identical (to the first decimal, at least). Both gave means, standard deviations, and key quantiles of the posterior distributions of the parameters, as well as R-hat, a measure of convergence you would like close to 1. The plots are slightly different, with RStan color coding the R-hat value vs. reporting it for R2jags. The output from RStan does not include a DIC value, at least by default.

R2jags Output

Inference for Bugs model at "rats.bug", fit using jags,
 3 chains, each with 10000 iterations (first 1000 discarded), n.thin = 9
 n.sims = 3000 iterations saved
          mu.vect sd.vect    2.5%     25%     50%     75%   97.5%  Rhat
alpha.c   242.390   3.712 237.001 240.654 242.431 244.237 247.839 1.129
alpha0    106.316   4.508  99.444 103.915 106.331 108.864 113.246 1.043
beta.c      6.185   0.109   5.968   6.116   6.185   6.258   6.394 1.002
sigma       6.136   1.182   5.266   5.776   6.065   6.395   7.088 1.001
tau.alpha   0.005   0.001   0.003   0.004   0.005   0.006   0.008 1.001
tau.beta    4.137   1.538   1.904   3.073   3.902   4.904   7.857 1.001
tau.c       0.027   0.004   0.020   0.024   0.027   0.030   0.036 1.001
deviance  967.610  23.168 941.121 957.316 966.043 976.319 998.467 1.001
          n.eff
alpha.c    3000
alpha0     3000
beta.c     1400
sigma      3000
tau.alpha  3000
tau.beta   3000
tau.c      3000
deviance   3000

For each parameter, n.eff is a crude measure of effective sample size,
and Rhat is the potential scale reduction factor (at convergence, Rhat=1).

DIC info (using the rule, pD = var(deviance)/2)
pD = 268.5 and DIC = 1236.1
DIC is an estimate of expected predictive error (lower deviance is better).

plot of chunk unnamed-chunk-1

RStan output

Inference for Stan model: anon_model.
3 chains: each with iter=11000; warmup=1000; thin=1; 11000 iterations saved.

                mean se_mean   sd   2.5%    25%    50%    75%  97.5% n_eff
alpha[1]       239.9     0.0  2.7  234.6  238.1  239.9  241.7  245.1 15672
alpha[2]       247.8     0.0  2.7  242.6  246.0  247.8  249.6  253.1 16865
alpha[3]       252.4     0.0  2.7  247.1  250.6  252.4  254.2  257.7 20956
alpha[4]       232.6     0.0  2.7  227.3  230.8  232.5  234.3  237.8 21050
alpha[5]       231.6     0.0  2.7  226.4  229.8  231.6  233.4  236.8 20250
alpha[6]       249.7     0.0  2.7  244.5  247.9  249.7  251.5  255.1 18570
alpha[7]       228.7     0.0  2.7  223.4  226.9  228.7  230.5  234.0 21257
alpha[8]       248.4     0.0  2.7  243.0  246.6  248.4  250.2  253.7 16278
alpha[9]       283.3     0.0  2.7  278.0  281.5  283.3  285.1  288.6 19244
alpha[10]      219.2     0.0  2.7  213.9  217.4  219.2  221.0  224.6 17471
alpha[11]      258.2     0.0  2.7  252.9  256.4  258.2  260.1  263.6 21935
alpha[12]      228.2     0.0  2.7  222.9  226.4  228.2  230.0  233.5 19933
alpha[13]      242.4     0.0  2.7  237.1  240.6  242.4  244.2  247.7 14641
alpha[14]      268.3     0.0  2.7  262.9  266.4  268.3  270.1  273.7 20241
alpha[15]      242.8     0.0  2.7  237.6  241.0  242.8  244.6  248.0 14321
alpha[16]      245.3     0.0  2.7  239.9  243.5  245.3  247.1  250.5 15314
alpha[17]      232.2     0.0  2.7  227.0  230.4  232.2  234.0  237.4 20874
alpha[18]      240.5     0.0  2.7  235.2  238.6  240.5  242.3  245.6 16301
alpha[19]      253.8     0.0  2.7  248.5  252.0  253.8  255.6  259.1 22001
alpha[20]      241.6     0.0  2.7  236.2  239.8  241.6  243.4  246.9 14330
alpha[21]      248.5     0.0  2.7  243.3  246.8  248.5  250.3  253.8 19178
alpha[22]      225.2     0.0  2.7  220.0  223.4  225.2  227.1  230.5 19358
alpha[23]      228.5     0.0  2.7  223.2  226.7  228.5  230.3  233.8 19742
alpha[24]      245.1     0.0  2.7  239.9  243.3  245.1  246.9  250.2 14794
alpha[25]      234.5     0.0  2.7  229.2  232.7  234.5  236.2  239.7 18778
alpha[26]      254.0     0.0  2.7  248.7  252.2  254.0  255.8  259.2 19957
alpha[27]      254.4     0.0  2.7  249.1  252.6  254.4  256.2  259.7 21171
alpha[28]      243.0     0.0  2.7  237.7  241.2  243.0  244.8  248.3 14643
alpha[29]      217.9     0.0  2.7  212.6  216.1  217.9  219.7  223.3 18663
alpha[30]      241.4     0.0  2.6  236.3  239.6  241.4  243.2  246.6 16161
beta[1]          6.1     0.0  0.2    5.6    5.9    6.1    6.2    6.5  1717
beta[2]          7.1     0.0  0.3    6.6    6.9    7.1    7.2    7.5  1052
beta[3]          6.5     0.0  0.2    6.0    6.3    6.5    6.6    7.0  1218
beta[4]          5.3     0.0  0.3    4.8    5.2    5.3    5.5    5.8  1187
beta[5]          6.6     0.0  0.2    6.1    6.4    6.6    6.7    7.0  1936
beta[6]          6.2     0.0  0.2    5.7    6.0    6.2    6.3    6.7  1651
beta[7]          6.0     0.0  0.2    5.5    5.8    6.0    6.1    6.4  1702
beta[8]          6.4     0.0  0.2    5.9    6.3    6.4    6.6    6.9  1926
beta[9]          7.1     0.0  0.3    6.6    6.9    7.1    7.2    7.6  1444
beta[10]         5.8     0.0  0.2    5.4    5.7    5.8    6.0    6.3  1514
beta[11]         6.8     0.0  0.2    6.3    6.6    6.8    7.0    7.3   780
beta[12]         6.1     0.0  0.2    5.7    6.0    6.1    6.3    6.6  1924
beta[13]         6.2     0.0  0.2    5.7    6.0    6.2    6.3    6.6  1283
beta[14]         6.7     0.0  0.3    6.2    6.5    6.7    6.9    7.2  1523
beta[15]         5.4     0.0  0.3    4.9    5.2    5.4    5.6    5.9  1000
beta[16]         5.9     0.0  0.2    5.4    5.8    5.9    6.1    6.4  1920
beta[17]         6.3     0.0  0.2    5.8    6.1    6.3    6.4    6.8  2247
beta[18]         5.8     0.0  0.2    5.4    5.7    5.8    6.0    6.3  1694
beta[19]         6.4     0.0  0.2    5.9    6.3    6.4    6.6    6.9  1184
beta[20]         6.1     0.0  0.2    5.6    5.9    6.1    6.2    6.5  1666
beta[21]         6.4     0.0  0.2    5.9    6.2    6.4    6.6    6.9  1618
beta[22]         5.9     0.0  0.2    5.4    5.7    5.9    6.0    6.3  2248
beta[23]         5.8     0.0  0.2    5.3    5.6    5.8    5.9    6.2  1597
beta[24]         5.9     0.0  0.2    5.4    5.7    5.9    6.0    6.4  2203
beta[25]         6.9     0.0  0.2    6.4    6.7    6.9    7.1    7.4  1778
beta[26]         6.5     0.0  0.2    6.1    6.4    6.5    6.7    7.0  1912
beta[27]         5.9     0.0  0.2    5.4    5.7    5.9    6.1    6.4  1546
beta[28]         5.8     0.0  0.2    5.4    5.7    5.8    6.0    6.3  1776
beta[29]         5.7     0.0  0.2    5.2    5.5    5.7    5.8    6.2  1514
beta[30]         6.1     0.0  0.2    5.7    6.0    6.1    6.3    6.6  1630
mu_alpha       242.4     0.0  2.8  236.9  240.6  242.4  244.3  247.9 12061
mu_beta          6.2     0.0  0.1    6.0    6.1    6.2    6.3    6.4  2855
sigmasq_y       37.3     0.1  5.7   27.8   33.2   36.7   40.7   50.0  2879
sigmasq_alpha  219.1     1.2 64.6  125.7  173.1  208.1  252.0  374.3  2934
sigmasq_beta     0.3     0.0  0.1    0.1    0.2    0.3    0.3    0.5   408
sigma_y          6.1     0.0  0.5    5.3    5.8    6.1    6.4    7.1  2864
sigma_alpha     14.7     0.0  2.1   11.2   13.2   14.4   15.9   19.3  2966
sigma_beta       0.5     0.0  0.1    0.4    0.5    0.5    0.6    0.7   402
alpha0         106.3     0.1  3.7   99.0  103.9  106.3  108.8  113.6  5365
lp__          -438.4     0.1  6.9 -453.0 -442.7 -437.9 -433.5 -426.2  2614
              Rhat
alpha[1]         1
alpha[2]         1
alpha[3]         1
alpha[4]         1
alpha[5]         1
alpha[6]         1
alpha[7]         1
alpha[8]         1
alpha[9]         1
alpha[10]        1
alpha[11]        1
alpha[12]        1
alpha[13]        1
alpha[14]        1
alpha[15]        1
alpha[16]        1
alpha[17]        1
alpha[18]        1
alpha[19]        1
alpha[20]        1
alpha[21]        1
alpha[22]        1
alpha[23]        1
alpha[24]        1
alpha[25]        1
alpha[26]        1
alpha[27]        1
alpha[28]        1
alpha[29]        1
alpha[30]        1
beta[1]          1
beta[2]          1
beta[3]          1
beta[4]          1
beta[5]          1
beta[6]          1
beta[7]          1
beta[8]          1
beta[9]          1
beta[10]         1
beta[11]         1
beta[12]         1
beta[13]         1
beta[14]         1
beta[15]         1
beta[16]         1
beta[17]         1
beta[18]         1
beta[19]         1
beta[20]         1
beta[21]         1
beta[22]         1
beta[23]         1
beta[24]         1
beta[25]         1
beta[26]         1
beta[27]         1
beta[28]         1
beta[29]         1
beta[30]         1
mu_alpha         1
mu_beta          1
sigmasq_y        1
sigmasq_alpha    1
sigmasq_beta     1
sigma_y          1
sigma_alpha      1
sigma_beta       1
alpha0           1
lp__             1

Sample were drawn using NUTS2 at Wed Sep  5 21:55:07 2012.
For each parameter, n_eff is a crude measure of effective sample size,
and Rhat is the potential scale reduction factor on split chains (at 
convergence, Rhat=1).

plot of chunk unnamed-chunk-1

One interesting difference between the two outputs is the R-hat value for the alpha0 variable. Alpha0 is generated quantity, representing the value of the intercept when non-centered data is used. For R2jags, the value of R-hat is 1.228, while R-hat is 1 for RStan. A quick look at the output indicates that R2jags used a thin value of 9, while RStan defaults to 1 (and creates a segfault when changed).

There is a major speed difference between the two methods. Now, it should be noted that JAGS can be faster on some problems and Stan can be faster on others. On my machine, the JAGS sampler took 7.1 seconds, while the Stan sampler took 25 seconds, which was a bit shocking to me. And this was timed using the second "stan" call, when the Stan model was pre-compiled. This is something that needs to be explored further.

Search This Blog

Full Text  Tag

Recent Assets

  • blog_logo.jpg

Tag Cloud

Subscribe