Abstract for: Bridging Statistics and Dynamic Modeling with Vensim, Python and Stan
This work describes Stanify, a new library for translating Vensim models into probabilistic programs defined with the Stan language. It is composed of two parts: a source-to-source code translator for model conversion and a miniature modeling language, V2S, for specifying Bayesian models on top of the Vensim model. Stanify brings together the powerful, intuitive interface for designing dynamic models of Vensim and the robust inference performance of Stan. By using Stanify users can specify priors for Vensim variables, declare observational models, and much more on top of their existing Vensim model without having to write any Stan code. Stan provides access to alternative algorithms, including Hamiltonian Monte Carlo, and a wide variety of diagnostics. The workflow includes two novelties: symmetry between generator and estimator can be leveraged to graphically validate procedures from end to end, including the model, priors, and methods; samples from the estimation can be reinjected to Vensim sensitivity simulations to support decision making under uncertainty. We introduce these methods with an example, exploring variants of the classic Lotka-Volterra predator-prey model, using Bayesian hierarchy and simulation-based calibration (SBC).