This final post about the STAN platform will specifically focus on data visualizations that can come from STAN models. In particular, we will explore these visualizations by hand with the popular shinystan package. As we already know, the STAN platform typically uses particular Markov Chain Monte Carlo (MCMC) algorithms: the Hamiltonian Monte Carlo (HMC) or […]
Bayesian inference
MCMC Using STAN – Diagnostics With The Bayesplot Package: Exercises
This exercise set will continue to present the STAN platform, but with another useful tool: the bayesplot package. This package is very useful to construct diagnostics that can be used to have insights on the convergence of the MCMC sampling since the convergence of the generated chains is the main issue in most STAN models. […]
MCMC Using STAN – Introduction With The Rstanarm Package: Exercises
This exercise set will continue the introduction to the STAN platform and its main features. Whereas the first post introduced the rstan package, we will now present the rstanarm package and related features. The goal here is to fit a series of regressions predicting cognitive test scores of children given characteristics of their mothers, using […]
MCMC Using STAN – An Introduction With The RSTAN Package: Exercises
This blog post is the first of a set of exercises about STAN that will introduce the STAN platform and how to link it with R. STAN is a statistical modeling platform that is used as an example for MCMC computations for Bayesian inference. It is more efficient for most analysis since it is written in […]
Bayesian Inference Using The MCMCglmm Package: Exercises
This post presents exercises using the MCMCglmm package in order to compute parameter estimates in a Bayesian fashion, relying on Mark Chain Monte Carlo (MCMC) methods. The MCMCglmm package typically deals with Generalized Linear (Mixed) Models (GLMM). This package mainly uses Gibbs Sampling to update the parameters, but also the Metropolis-Hastings. Course notes are available […]
MCMC For Bayesian Inference – Gibbs Sampling: Exercises
In the last post, we saw that the Metropolis sampler can be used in order to generate a random sample from a posterior distribution that cannot be found analytically. Following the same idea, Gibbs sampling is a popular Markov Chain Monte Carlo (MCMC) technique that is more efficient, in general, since the updates of the […]
MCMC for Bayesian Inference – Metropolis: Exercises
Previously, we introduced Bayesian Inference with R using the Markov Chain Monte Carlo (MCMC) techniques. The first set of exercises gave insights on the Bayesian paradigm, while the second set focused on well-known sampling techniques that can be used to generate a sample from the posterior distribution . While the next set of exercises will […]
Basic Bayesian Inference for MCMC Techniques: Exercises (Part 2)
In the first part , we saw a small introduction of the Bayesian inference and a first approach of Monte-Carlo techniques. Now, we will get through the Monte Carlo in order to obtain a random sample from the posterior distribution using some common techniques. Then, the next post will present the well-known Metropolis(-Hastings), Gibbs sampler, […]
Basic Bayesian Inference for MCMC techniques : Solutions (Part 1)
Below are the solutions to these exercises on “Bayesian Inference : introduction for MCMC techniques (part 1)”. ############### # # # Exercise 1 # # # ############### # a. Binomial distribution with n = 1000 and probability of ‘success’ = 735/1000 plot(dbinom(x = seq(1, 100, 1), size = 100, prob = 735/1000), type = "l", […]
Basic Bayesian Inference for MCMC techniques : Exercises (Part 1)
This post aims to introduce you to the basics of Bayesian inference. The ultimate goal of this introductory set of exercises is to get you ready for Bayesian inference using Markov Chain Monte Carlo (MCMC). Little reminder The whole Bayesian paradigm is based on the Bayesian Theorem that we all know (right ?), generally formulated […]








