Bayesian

Pivoting posteriors

In Stan, when a parameter is declared as an array, the samples/draws data frame will have columns that use the [i] notation to denote the i-th element of the array. For example, suppose we had a model with two parameters – (\lambda_1) and a (\lambda_2). Instead of declaring them individually – e.g. lambda1 and lambda2, respectively – we may declare them as a single lambda array of size 2: parameters { real lambda[2]; } When we sample from that model, we will end up with samples for lambda[1] and lambda[2].

Replacing the knitr engine for Stan

2020-08-03 UPDATE: Good news! A version of this engine is now included in versions 0.1.1 and later of {CmdStanR}. Use cmdstanr::register_knitr_engine() at the top of the R Markdown document to register it as the engine for stan chunks. See the vignette R Markdown CmdStan Engine for examples. Shoutout to the maintainers Jonah Gabry & Rok Češnovar for a super positive code review experience with the pull request for this. I originally dabbled with custom {knitr} engine creation last month, when I made {dotnet} which enables R Markdown users to write chunks with C# and F# programs in them.

Bayesian Optimization in R

A tutorial on using Bayesian optimization to find the minimum of a function with only a few evaluations of the functions, using different approaches to identify the best next value to evaluate the function at.

Probabilistic programming languages for statistical inference

Introduction This post was inspired by a question about JAGS vs BUGS vs Stan: right, that’s what got me confused! so they.. do the same thing? — Andrew MacDonald, January 10, 2017 Explaining the differences would be too much for Twitter, so I’m just gonna give a quick explanation here. 2020-05-18 update: Coming from a background of statistical inference in the context of academia and research using R, where these have been the prevalent PPLs for quite some time, I admittedly have a bit of a blind spot for PyMC3.