<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/stan-weekly-roundup-7-july-2017/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://andrewgelman.com/2017/07/07/stan-weekly-roundup-7-july-2017/"> R – Statistical Modeling, Causal Inference, and Social Science</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>Holiday weekend, schmoliday weekend.</p>
<ul>
<li><b>Ben Goodrich</b> and <b>Jonah Gabry</b> shipped <a rel="nofollow" href="https://cran.r-project.org/web/packages/rstan/index.html" target="_blank">RStan 2.16.2</a> (their numbering is a little beyond base Stan, which is at 2.16.0). This reintroduces error reporting that got lost in the 2.15 refactor, so please upgrade if you want to debug your Stan programs!</li>
<li><b>Joe Haupt</b> translated the JAGS examples in the second edition of John Kruschke’s book <i>Doing Bayesian Data Analysis</i> into Stan. Kruschke <a rel="nofollow" href="http://andrewgelman.com/2017/07/07/stan-weekly-roundup-7-july-2017/" target="_blank">blogged it</a> and Haupt has a <a rel="nofollow" href="https://github.com/jhoupt/DBDA2Estan" target="_blank">GitHub page with the Stan programs</a>. I still owe him some comments on the code.</li>
<li><b>Andrew Gelman</b> has been working on the second edition of his and Jennifer Hill’s regression book, which is being rewritten as two linked books and translated to Stan. He’s coordinating with <b>Jonah Gabry</b> and <b>Ben Goodrich</b> on the RStanArm replacements for lme4 and lm/glm in R.</li>
<li><b>Sean Talts</b> got in the pull request for enabling C++11/C++14 in Stan. This is huge for us developers as we have a lot of pent-up demand for C++11 features on the back burner.</li>
<li><b>Michael Betancourt</b>, with feedback from the NumFOCUS advisory board for Stan, put together a <a rel="nofollow" href="http://mc-stan.org/about/logo/index.html" target="_blank">web page of guidelines for using the Stan trademarks</a>.</li>
<li><b>Gianluca Baio</b> released version 1.0.5 of <a rel="nofollow" href="https://cran.r-project.org/web/packages/survHE/index.html" target="_blank">survHE</a>, a survival analysis package based on RStan (and INLA and ShinyStan). There’s also the GitHub repo that <b>Jacki Buros Novik</b> made available with a <a rel="nofollow" href="https://github.com/hammerlab/survivalstan" target="_blank">library of survival analysis models in Stan</a>. Techniques from these packages will probably make their way into RStanArm eventually (Andrew’s putting in a survival analysis example in the new regression book).</li>
<li><b>Mitzi Morris</b> finished testing the Besag-York-Mollie model in Stan and it passes the Cook-Gelman-Rubin diagnostics. Given that GeoBUGS gets a different answer, we now think it’s wrong, but those tests haven’t completed running yet (it’s much slower than Stan in terms of effective sample size per unit time if you want to get to convergence).</li>
<li><b>Imad Ali</b> has been working with Mitzi on getting the BYM model into RStanArm.</li>
<li><b>Jonah Gabry</b> taught a one-day Stan class in Padua (Italy) while on vacation. That’s how much we like talking about Stan.</li>
<li><b>Ben Goodrich</b> just gave a Stan talk at the <a rel="nofollow" href="https://user2017.sched.com/event/Axqm/how-to-use-rstan-to-estimate-models-in-external-r-packages" target="_blank">Brussels useR conferece</a> group following close on the heels of his <a rel="nofollow" href="https://www.meetup.com/Zalando-Tech-Events-Berlin/events/240986840/" target="_blank">Berlin meetup</a>. You can find a lot of information about upcoming events at our <a rel="nofollow" href="http://mc-stan.org/events/" target="_blank">events page</a>.

<li><b>Mitzi Morris</b> and <b>Michael Betancourt</b> will be teaching a <a rel="nofollow" href="https://www.meetup.com/NYC-Women-in-Machine-Learning-Data-Science/events/240870777/" target="_blank">one-day Stan course for the Women in Machine Learning meetup</a> event in New York on 22 July 2017 hosted by Viacom. Dan Simpson’s <a rel="nofollow" href="http://andrewgelman.com/2017/07/05/stannyc-wimlds-workshop/" target="_blank">comment on the blog post</a> was priceless.</li>
<li><b>Martin Černý</b> improved feature he wrote to implement a <a rel="nofollow" href="https://github.com/stan-dev/stan/pull/2347" target="_blank">standalone function parser</a> for Stan (to make it easier to expose functions in R and Python).</li>
<li><b>Aki Vehtari</b> arXived a new version of the horseshoe prior paper with a parameter to control regularization more tightly, especially for logistic regression. It has the added benefit of being more robust and removing divergent transitions in the Hamiltonian simulation. Look for that to land in RStanArm soon.</li>
<li><b>Charles Margossian</b> continues to make speed improvements on the Stan models for Torsten and is also working on getting the <a rel="nofollow" href="https://github.com/stan-dev/stan/pull/2339" target="_blank">algebraic equation solver into Stan</a> so we can do fixed points of diff eqs and other fun applications. If you follow the link to the pull request, you can also see my extensive review of the code. It’s not easy to put a big feature like this into Stan, but we provide lots of help.</li>
<li><b>Marco Inacio</b> got in a pull request for definite numerical integration. There are needless to say all sorts of subtle numerical issues swirling around integrating. Marco is working from <a rel="nofollow" href="https://www.johndcook.com/blog/numerical-integration/" target="_blank">John Cook’s basic implemnetation of numerical integration</a> and John’s been nice enough to offer it under a BSD license so it would be compatible with Stan.</li>
<li><b>Rayleigh Lei</b> is working on vectorizing all the binary functions and has a branch with the testing framework. This is really hairy template programming, but probably a nice break after his first year of grad school at U. Michigan!</li>
<li><b>Allen Riddell</b> and <b>Ari Hartikainen</b> have been working hard on Windows compatibility for PyStan, which is no walk in the park. Windows has been the bane of our existence since starting this project and if all the world’s applied statisticians switched to Unix (Linux or Mac OS X), we wouldn’t shed a tear.</li>
<li><b>Yajuan Si</b>, Andrew Gelman, Rob Trangucci, and Jonah Gabry have been working on a survey weighting module for RStanArm. Sounds like RStanArm’s quickly becoming the swiss army knife (leatherman?) of Bayesian modeling.</li>
<li> <b>Andrew Gelman</b> finished a paper on (issues with) NHST and is wondering about clinical effects that are small by design because they’re being compared to the state of the art treatment as a baseline.</li>
<li>My own work on mixed mode tests continues apace. The <a rel="nofollow" href="https://github.com/stan-dev/math/pull/572" target="_blank">most recent pull request</a> adds logical operators (and, or, not) to our autodiff library (it’s been in Stan—this is just rounding out the math lib operators directly) and removed 4000 lines of old code (replacing it with 1000 new lines, but that includes doc and three operators in both forward and reverse mode). I’m optimistic that this will eventually be done and we’ll have RHMC and autodiff Laplace approximations.</li>
<li><b>Ben Bales</b> submitted a <a rel="nofollow" href="https://github.com/stan-dev/stan/pull/2343" target="_blank">pull request for appending arrays</a>, which is under review and will be generalized to arbitary Stan array types.</li>
<li><b>Ben Bales</b> also submitted a pull request for the initial <a rel="nofollow" href="https://github.com/stan-dev/math/pull/573" target="_blank">vectorization of RNGs</a>. This should make programs doing posterior predictive inference so much cleaner.
</li>

<li>I wrote a <a rel="nofollow" href="https://github.com/stan-dev/stan/wiki/Standalone-Generated-Quantities:-Functional-Specification" target="_blank">functional spec for standalone generated quantities</a>. This would let us do posterior predictive inference after fitting the model. As you can see, even simple things like this take a lot of work. That spec is conservative on a task-by-task basis, but given the correlations among tasks, probably not so conservative in total.</li>
<li>I also <a rel="nofollow" href="https://github.com/stan-dev/stan/pull/2345" target="_blank">patched potentially undefined bools</a> in Stan; who knew that C++ would initialize a bool in a class to values like 127. This followed on from Ben Goodrich filing the issue after some picky R compiler flagged some undefined behavior. Not a bug, but the code’s cleaner now.</li>
</ul>
<p>The post <a rel="nofollow" href="http://andrewgelman.com/2017/07/07/stan-weekly-roundup-7-july-2017/" target="_blank">Stan Weekly Roundup, 7 July 2017</a> appeared first on <a rel="nofollow" href="http://andrewgelman.com/" target="_blank">Statistical Modeling, Causal Inference, and Social Science</a>.</p>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://andrewgelman.com/2017/07/07/stan-weekly-roundup-7-july-2017/"> R – Statistical Modeling, Causal Inference, and Social Science</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/YSemSTY6QGk" height="1"></a></div>