Stan Weekly Roundup, 28 July 2017

Stan Weekly Roundup, 28 July 2017 Here’s the roundup for this past week. Michael Betancourt added case studies for methodology in both Python and R, based on the work he did getting the ML meetup together: Michael Betancourt, along with Mitzi Morris, Sean Talts, and Jonah Gabry taught the women in ML workshop at Viacom in NYC and there were 60 attendees working their way up from simple linear regression, through Poisson regression to GPs. Ben Goodrich has been working on new R^2 analyses and priors, as well as the usual maintenance on RStan and RStanArm. Aki Vehtari was at the summer school in Valencia teaching Stan. Aki has also been kicking off planning for StanCon in Helsinki 2019. Can’t believe we’re planning that far ahead! Sebastian Weber was in Helsinki giving a talk on Stan, but there weren’t many…
Original Post: Stan Weekly Roundup, 28 July 2017

Stan Weekly Roundup, 21 July 2017

Stan Weekly Roundup, 21 July 2017 It was another productive week in Stan land. The big news is that Jonathan Auerbach, Tim Jones, Susanna Makela, Swupnil Sahai, and Robin Winstanley won first place in a New York City competition for predicting elementary school enrollment. Jonathan told me, “I heard 192 entered, and there were 5 finalists….Of course, we used Stan (RStan specifically). … Thought it might be Stan news worthy.” I’d say that’s newsworthy. Jon also provided a link to the “challenge” page, a New York City government sponsored “call for innovations”: Enhancing School Zoning Efforts by Predicting Population Change. They took home a US$20K paycheck for their efforts! Stan’s seeing quite a lot of use these days among demographers and others looking to predict forward from time series data. Jonathan’s been very active using government data sets (see his…
Original Post: Stan Weekly Roundup, 21 July 2017

Short course on Bayesian data analysis and Stan 23-25 Aug in NYC!

Jonah “ShinyStan” Gabry, Mike “Riemannian NUTS” Betancourt, and I will be giving a three-day short course next month in New York, following the model of our successful courses in 2015 and 2016. Before class everyone should install R, RStudio and RStan on their computers. (If you already have these, please update to the latest version of R and the latest version of Stan.) If problems occur please join the stan-users group and post any questions. It’s important that all participants get Stan running and bring their laptops to the course. Class structure and example topics for the three days: Day 1: FoundationsFoundations of Bayesian inferenceFoundations of Bayesian computation with Markov chain Monte CarloIntro to Stan with hands-on exercisesReal-life StanBayesian workflow Day 2: Linear and Generalized Linear ModelsFoundations of Bayesian regressionFitting GLMs in Stan (logistic regression, Poisson regression)Diagnosing model misfit using…
Original Post: Short course on Bayesian data analysis and Stan 23-25 Aug in NYC!

Make Your Plans for Stans (-s + Con)

Make Your Plans for Stans (-s + Con) This post is by Mike A friendly reminder that registration is open for StanCon 2018, which will take place over three days, from Wednesday January 10, 2018 to Friday January 12, 2018, at the beautiful Asilomar Conference Grounds in Pacific Grove, California. Detailed information about registration and accommodation at Asilomar, including fees and instructions, can be found on the event website.  Early registration ends on Friday November 10, 2017 and no registrations will be accepted after Wednesday December 20, 2017. We have an awesome set of invited speakers this year that is worth attendance alone, Susan Holmes (Department of Statistics, Stanford University) Sean Taylor and Ben Letham (Facebook Core Data Science) Manuel Rivas (Department of Biomedical Data Science, Stanford University) Talia Weiss (Department of Physics, Massachusetts Institute of Technology) Sophia Rabe-Hesketh and Daniel Furr (Educational Statistics and Biostatistics,…
Original Post: Make Your Plans for Stans (-s + Con)

A continuous hinge function for statistical modeling

This comes up sometimes in my applied work: I want a continuous “hinge function,” something like the red curve above, connecting two straight lines in a smooth way. Why not include the sharp corner (in this case, the function y=-0.5x if x<0 or y=0.2x if x>0)? Two reasons. First, computation: Hamiltonian Monte Carlo can trip on discontinuities. Second, I want a smooth curve anyway, as I’d expect it to better describe reality. Indeed, the linear parts of the curve are themselves typically only approximations. So, when I’m putting this together, I don’t want to take two lines and then stitch them together with some sort of quadratic or cubic, creating a piecewise function with three parts. I just want one simple formula that asymptotes to the lines, as in the above picture. As I said, this problem comes up occasion,…
Original Post: A continuous hinge function for statistical modeling

Using Stan for week-by-week updating of estimated soccer team abilites

Milad Kharratzadeh shares this analysis of the English Premier League during last year’s famous season. He fit a Bayesian model using Stan, and the R markdown file is here. The analysis has three interesting features: 1. Team ability is allowed to continuously vary throughout the season; thus, once the season is over, you can see an estimate of which teams were improving or declining. 2. But that’s not what is shown in the plot above. Rather, the plot above shows estimated team abilities after the model was fit to prior information plus week 1 data alone; prior information plus data from weeks 1 and 2; prior information plus data from weeks 1, 2, and 3; etc. For example, look at the plot for surprise victor Leicester City: after a few games, the team is already estimated to be in the…
Original Post: Using Stan for week-by-week updating of estimated soccer team abilites

Splines in Stan! (including priors that enforce smoothness)

Milad Kharratzadeh shares a new case study. This could be useful to a lot of people.Just for example, here’s the last section of the document, which shows how to simulate the data and fit the model graphed above:Location of Knots and the Choice of Priors In practical problems, it is not always clear how to choose the number/location of the knots. Choosing too many/too few knots may lead to overfitting/underfitting. In this part, we introduce a prior that alleviates the problems associated with the choice of number/locations of the knots to a great extent. Let us start by a simple observation. For any given set of knots, and any B-spline order, we have: $$ sum_{i} B_{i,k}(x) = 1. $$ The proof is simple and can be done by induction. This means that if the B-spline coefficients, $a_i = a$, are…
Original Post: Splines in Stan! (including priors that enforce smoothness)

StanCon 2017 Schedule

StanCon 2017 Schedule Posted by Daniel on 11 January 2017, 12:39 pm The first Stan Conference is next Saturday, January 21, 2017! If you haven’t registered, here’s the link: https://stancon2017.eventbrite.comI wouldn’t wait until the last minute — we might sell out before you’re able to grab a ticket. We’re up to 125 registrants now.(If we have any tickets left, they are $400 at the door.) Schedule. January 21, 2017. Time What 7:30 AM – 8:45 AM Registration and breakfast 8:45 AM – 9:00 AM Opening statements 9:00 AM – 10:00 AM Dev talk:Andrew Gelman:“10 Things I Hate About Stan” 10:00 AM – 10:30 AM Coffee 10:30 AM – 12:00 PM Contributed talks: Jonathan Auerbach, Rob Trangucci:“Twelve Cities: Does lowering speed limits save pedestrian lives?” Milad Kharratzadeh:“Hierarchical Bayesian Modeling of the English Premier League” Victor Lei, Nathan Sanders, Abigail Dawson:“Advertising Attribution Modeling…
Original Post: StanCon 2017 Schedule

R packages interfacing with Stan: brms

R packages interfacing with Stan: brms Posted by Jonah on 10 January 2017, 8:45 pm Over on the Stan users mailing list I (Jonah) recently posted about our new document providing guidelines for developing R packages interfacing with Stan. As I say in the post and guidelines, we (the Stan team) are excited to see the emergence of some very cool packages developed by our users. One of these packages is Paul Bürkner’s brms. Paul is currently working on his PhD in statistics at the University of Münster, having previously studied psychology and mathematics at the universities of Münster and Hagen (Germany). Here is Paul writing about brms: The R package brms implements a wide variety of Bayesian regression models using extended lme4 formula syntax and Stan for the model fitting. It has been on CRAN for about one and a…
Original Post: R packages interfacing with Stan: brms

Stan 2.14 released for R and Python; fixes bug with sampler

Stan 2.14 released for R and Python; fixes bug with sampler Stan 2.14 is out and it fixes the sampler bug in Stan versions 2.10 through 2.13. Critical update It’s critical to update to Stan 2.14. See: The other interfaces will update when you udpate CmdStan. The process After Michael Betancourt diagnosed the bug, it didn’t take long for him to generate a test statistic so we can test this going forward, then submit a pull request for the patch and new test. I code reviewed that and made sure a clean check out did the right thing and then we merged. We had a few other fixes in, including one from Mitzi Morris that completed the compound declare define feature. Then Mitzi and Daniel built the releases for the Stan math library, the core Stan C++ library, and then…
Original Post: Stan 2.14 released for R and Python; fixes bug with sampler