**Topics:** Basic probability.

**Topics:** Introduction to the R software package.

- Overview of R and RStudio, and setting up an RStudio project. There is no material for this overview where you are expected to follow along and set things up.
- Introduction to R commands etc. We go through the material in R-demo.pdf in a live programming session. (Correspondig script: R-demo.R)
- Introduction to Rmarkdown documents. As an example we will look at the file exercises02.Rmd which was used to generate the exercises for module 2. Solutions are provided in pdf and Rmd formats.

**Topics:** Bayesian principle, the binomial model, conjugate priors.

Please read sections 1-2.2 in the notes *A brief introduction to Bayesian inference*.

- We start by going through this material about the binomial model mainly covering likelihood inference and only briefly introducing Bayesian inference. The exercises for this part are here, and you may use the Rmarkdown file as a template for answering the exercises. Solutions are provided in pdf and Rmd formats.
- We then go through the main slides with more details about the binomial model in the Bayesian setting and more. For this part solve exercises 1, 2, and 3 in the notes
*A brief introduction to Bayesian inference*. (If you don't manage to solve all 3 exercises, you may continue in the afternoon.) Here you find the solutions.

**Topics:** The Gaussian model, conjugate and improper priors.

Please read sections 2.3-2.6 in the notes *A brief introduction to Bayesian inference*.

**Topics:** Introduction to simulation based inference.

- We first go through the main slides.
- Then the supplementary material contains a lot of the details of the implementation in R.
- The first exercise concerns this R implementation. Solutions are provided in pdf and Rmd formats.
- Finally, the remaining time is devoted to this mark-and-recapture exercise. This frequentist analysis mainly uses material from lecture 3, while we at a later stage will conduct a Bayesian analysis. It may be convenient to download this Rmarkdown source file for the exercise. Solution is provided in pdf and Rmd formats. Also a comment about the likelihood is available

**Topics:** The Gibbs sampler.

Read about Gibbs sampling, see Section 8 in "A short diversion into...". A minor point: Notice that the gamma distribution is parameterised differently from what we have done so far in this course.

**Topics:** More Markov chain Monte Carlo methods.

- We first go through the supplementary material which concerns rejection sampling and practical aspects in R.
- Then there is time to work on exercises about rejection sampling. Solutions are provided in pdf and Rmd formats.
- Then we go through the main slides.
- Finally, there is time to work on this exercise. Solutions are provided in pdf and Rmd formats.

**Topics:** More MCMC: Invariant density, irreducibility, Metropolis-Hastings algorithm.

**Topics:** More MCMC: Metropolis-Hastings algorithm, burn-in, tuning.

**Topics:** Bayesian prediction and model checking.

**Topics:** A mixture model and JAGS.

- Main slides (mixture model)
- Supplementary slides (JAGS)
- Exercises
- Hints for exercises (not full solution) (Rmd format)

The final module is devoted to the hand-in exercise that must be completed to obtain credit for the course (see the front page for the hand-in date).