Skip to content
Archive of posts filed under the Stan category.

Tracking R of COVID-19 & assessing public interventions; also some general thoughts on science

Simas Kucinskas writes:

Conference on Mister P online tomorrow and Saturday, 3-4 Apr 2020

We have a conference on multilevel regression and poststratification (MRP) this Friday and Saturday, organized by Lauren Kennedy, Yajuan Si, and me. The conference was originally scheduled to be at Columbia but now it is online. Here is the information. If you want to join the conference, you must register for it ahead of time; […]

More coronavirus research: Using Stan to fit differential equation models in epidemiology

Seth Flaxman and others at Imperial College London are using Stan to model coronavirus progression; see here (and I’ve heard they plan to fix the horrible graphs!) and this Github page. They also pointed us to this article from December 2019, Contemporary statistical inference for infectious disease models using Stan, by Anastasia Chatzilena et al. […]

“Partially Identified Stan Model of COVID-19 Spread”

Robert Kubinec writes: I am working with a team collecting government responses to the coronavirus epidemic. As part of that, I’ve designed a Stan time-varying latent variable model of COVID-19 spread that only uses observed tests and cases. I show while it is impossible to know the true number of infected cases, we can rank/sign […]

Fit nonlinear regressions in R using stan_nlmer

This comment from Ben reminded me that lots of people are running nonlinear regressions using least squares and other unstable methods of point estimation. You can do better, people! Try stan_nlmer, which fits nonlinear models and also allows parameters to vary by groups. I think people have the sense that maximum likelihood or least squares […]

Structural equation modeling and Stan

Eric Brown asks: How does Stan and its Bayesian modeling relate to structural equation modeling? Do you know of a resource that attempts to explain the concepts behind SEM in terms of Stan nomenclature and concepts? Some research that I’ve looked into uses SEM to evaluate latent factors underlying multiple measurements with associated errors; or […]

The second derivative of the time trend on the log scale (also see P.S.)

Peter Dorman writes: Have you seen this set of projections? It appears to have gotten around a bit, with citations to match, and IHME Director Christopher Murray is a superstar. (WHO Global Burden of Disease) Anyway, I live in Oregon, and when you compare our forecast to New York State it gets weird: a resource […]

Another Bayesian model of coronavirus progression

Jon Zelner writes: Just ran across this paper [Estimating unobserved SARS-CoV-2 infections in the United States, by T. Alex Perkins, Sean Cavany, Sean Moore, Rachel Oidtman, Anita Lerch, and Marya Poterek] which I think is worth signal-boosting. I [Jon] also think that the model in here could potentially be implemented in Stan (though it might […]

Prior predictive, posterior predictive, and cross-validation as graphical models

I just wrote up a bunch of chapters for the Stan user’s guide on prior predictive checks, posterior predictive checks, cross-validation, decision analysis, poststratification (with the obligatory multilevel regression up front), and even bootstrap (which has a surprisingly elegant formulation in Stan now that we have RNGs in trnasformed data). Andrew then urged me to […]

“A Path Forward for Stan,” from Sean Talts, former director of Stan’s Technical Working Group

Sean Talts was talking about his ideas of how Stan should move forward, given anticipated developments in the probabilistic programming infrastructure. I encouraged his to write up his ideas in some sort of manifesto form, and he did so. Here it is. The title is “A Path Forward for Stan,” and it begins: Stan has […]

Sponsor a Stan postdoc or programmer!

There’s lots of great stuff going on with Stan and related research on Bayesian workflow and computation. One way that we can do more for the community is by hosting postdocs and programmers. And one way this can happen is from corporate support. The idea is that the postdoc or programmer is working on projects […]

A factor of 40 speed improvement . . . that’s not something that happens every day!

Charles Margossian and Ben Bales helped out with the Stan model for coronavirus from Riou et al. Riou reports: You guys are amazing. We implemented your tricks and it reduced computation time from 3.5 days to … 2 hours (40 times less). This is way beyond what I expected, thank you so much!

Coronavirus model update: Background, assumptions, and room for improvement

Julien Riou, coauthor of one of the models we discussed here, writes: Here is an overview of the current state of the project, so that it is easier for everyone to quickly grasp what is the potential room for improvement. Background on the epidemic: COVID-19 just passed 100,000 confirmed cases all over the world, and […]

Coronavirus age-specific fatality ratio, estimated using Stan, and (attempting) to account for underreporting of cases and the time delay to death. Now with data and code. And now a link to another paper (also with data and code).

Julien Riou writes: Stan epidemiologist here. We actually just released a preprint [estimating death rates of people infected with coronavirus, breaking down the population by age and then poststratifying] using Stan (https://www.medrxiv.org/content/10.1101/2020.03.04.20031104v1). Crude estimates of case fatality ratio obtained by dividing observed deaths by observed cases are biased in two ways: 1) Deaths are underestimated […]

The Great Society, Reagan’s revolution, and generations of presidential voting

> Continuing our walk through the unpublished papers list: This one’s with Yair and Jonathan: We build a model of American presidential voting in which the cumulative impression left by political events determines the preferences of voters. This impression varies by voter, depending on their age at the time the events took place. We find […]

What can we do with complex numbers in Stan?

I’m wrapping up support for complex number types in the Stan math library. Now I’m wondering what we can do with complex numbers in statistical models. Functions operating in the complex domain The initial plan is to add some matrix functions that use complex numbers internally: fast fourier transforms asymmetric eigendecomposition Schur decomposition The eigendecomposition […]

Rank-normalization, folding, and localization: An improved R-hat for assessing convergence of MCMC

With Aki, Dan, Bob, and Paul: Markov chain Monte Carlo is a key computational tool in Bayesian statistics, but it can be challenging to monitor the convergence of an iterative stochastic algorithm. In this paper we show that the convergence diagnostic R-hat of Gelman and Rubin (1992) has serious flaws. R-hat will fail to correctly […]

A normalizing flow by any other name

Another week, another nice survey paper from Google. This time: Papamakarios, G., Nalisnick, E., Rezende, D.J., Mohamed, S. and Lakshminarayanan, B., 2019. Normalizing Flows for Probabilistic Modeling and Inference. arXiv 1912.02762. What’s a normalizing flow? A normalizing flow is a change of variables. Just like you learned way back in calculus and linear algebra. Normalizing […]

Making differential equation models in Stan more computationally efficient via some analytic integration

We were having a conversation about differential equation models in pharmacometrics, in particular how to do efficient computation when fitting models for dosing, and Sebastian Weber pointed to this Stancon presentation that included a single-dose model. Sebastian wrote: Multiple doses lead to a quick explosion of the Stan codes – so things get a bit […]

MRP Conference at Columbia April 3rd – April 4th 2020

The Departments of Statistics and Political Science and Institute for Social and Economic Research and Policy at Columbia University are delighted to invite you to our Spring conference on Multilevel Regression and Poststratification. Featuring Andrew Gelman, Beth Tipton, Jon Zelner, Shira Mitchell, Qixuan Chen and Leontine Alkema, the conference will combine a mix of cutting […]