Aalto 2020 course will be completely online.

- MyCourses is used for important announcements and some questionnaires.
- Most of the communication happens in the course chat (see below)

All the course material is available in a git repo (and these pages are for easier navigation). All the material can be used in other courses. Text and videos licensed under CC-BY-NC 4.0. Code licensed under BSD-3.

The material will be updated during the course. Exercise instructions and slides will be updated at latest on Monday of the corresponding week. The updated material will appear on web pages, or you can clone the repo and pull before checking new material. If you don’t want to learn git, you can download the latest zip file.

The electronic version of the course book Bayesian Data Analysis, 3rd ed, by by Andrew Gelman, John Carlin, Hal Stern, David Dunson, Aki Vehtari, and Donald Rubin is available for non-commercial purposes. Hard copies are available from the publisher and many book stores. Aalto library has also copies. See also home page for the book, errata for the book, and chapter notes.

- Basic terms of probability theory
- probability, probability density, distribution
- sum, product rule, and Bayes’ rule
- expectation, mean, variance, median
- in Finnish, see e.g. Stokastiikka ja tilastollinen ajattelu
- in English, see e.g. Wikipedia and Introduction to probability and statistics

- Some algebra and calculus
- Basic visualisation techniques (R or Python)
- histogram, density plot, scatter plot
- see e.g. BDA R demos
- see e.g. BDA Python demos

This course has been designed so that there is strong emphasis in computational aspects of Bayesian data analysis and using the latest computational tools.

If you find BDA3 too difficult to start with, I recommend

- For regression models, their connection to statistical testing and causal analysis see Gelman, Hill and Vehtari, “Regression and Other Stories”.
- Richard McElreath’s Statistical Rethinking, 2nd ed book is easier than BDA3 and the 2nd ed is excellent. Statistical Rethinking doesn’t go as deep in some details, math, algorithms and programming as BDA course. Richard’s lecture videos of Statistical Rethinking: A Bayesian Course Using R and Stan are highly recommended even if you are following BDA3.
- For background prerequisites some students have found chapters 2, 4 and 5 in Kruschke, “Doing Bayesian Data Analysis” useful.

- MyCourses is used for important announcements and some questionnaires.
- The primary communication channel is the course chat.
- Don’t ask via email or direct messages. By asking via common channels in the course chat, more eyes will see your question, it will get answered faster and it’s likely that other students benefit from the answer.
- Login with Aalto account to the course chat (it looks like Microsoft Teams login, but just use your Aalto account and it works)
- If you have any questions, please ask in the public channels and get answers from course staff or other students (active students helping others will get bonus points)
- In the chat system, we will have separate channels for each assignment and the project.
- Channel
**#general**can be used for any kind of general discussions and questions related to the course. - All important announcements will be posted to
**#announcements**(no discussion on this channel). - Any kind of feedback is welcome on channel
**#feedback**. - We have also channels
**#r**,**#python**, and**#stan**for questions that are not specific to assignments or the project. - Channel
**#queue**is used as a queue for getting help during TA sessions. - The lecturer and teaching assistants have names with “(staff)” or “(TA)” in the end of their names.

- A weekly Q&A session with the lecturer happens in Zoom webinar (see times below)
- Q&A session assumes you have self studied at least some of the material before the session
- Q&A session will remind about the important announcements
- Zoom webinar polls, Q&A feature, chat, and audio talking will be used for interaction
- Zoom webinar polls don’t show up in browser zoom client! If you want to see the polls and the poll results, install a desktop client.
- The form of the Q&A session will develop based on the feedback from the students
- Q&A session is not recorded, but the answers to most relevant questions will be shared or short additional videos will be recorded

- If you need one-to-one help, please take part in the TA sessions and ask there.
- If you find errors in material, post in
**#feedback**channel or submit an issue in github. - Peergrade alerts: If you are worried that you forget the deadlines, you can set peergade to send you email when assignment opens for submission, 24 hours before assignment close for submission, assignment is open for reviewing, 24 hours before an assignment closes for reviewing if you haven’t started yet, someone likes my feedback (once a day). Click your name -> User Settings to choose which alerts you want.

Assignments (67%) and a project work with presentation (33%). Minimum of 50% of points must be obtained from both the assignments and project work.

The course consists of 12 blocks in periods I and II. The blocks don’t match exactly specific weeks. For example, it’s good start reading the material for the next block while making the assignment for one block. There are 9 assignments and a project work with presentation, and thus the assignments are not in one-to-one correspondence with the blocks. The schedule below lists the blocks and how they connect to the topics, book chapters and assignments.

Currently the video links are for the videos recorded 2019. Part of the videos will be re-recorded.

Here is an overview of the schedule. Scroll down the page to see detailed instructions for each block. Remember that blocks are overlapping so that when you are working on assignment for one block, you should start watching videos and reading text for the next block.

Course practicalities, material, assignments, project work, peergrading, QA sessions, TA sessions, prerequisites, chat, etc.

- Login with Aalto account to the course chat
- Signin to Peergrade with the class code shared in email and in the course chat
- Watch videos
- Introduction/practicalities lecture and Q&A
**Monday 7.9. 14:15-16**- Zoom webinar link will be emailed, and posted to the course chat and MyCourses

- Read BDA3 Chapter 1
- start with reading instructions for Chapter 1 and afterwards read the additional comments in the same document

- There are no R/Python demos for Chapter 1
- Make and submit Assignment 1.
**Deadline Sunday 13.9. 23:59**- this assignment checks that you have sufficient prerequisite skills (basic probability calculus, and R or Python)
- General information about assignments
- R markdown template for assignments
- FAQ for the assignments has solutions to commonly asked questions related RStudio setup, errors during package installations, etc.

- Get help in TA sessions Wednesday 9.9. 12-16, Thursday 10.9. 12-14, or Friday 11.9. 12-14
- in Oodi these are marked as exercise sessions
- these are optional and you can choose which one to join
- see more info about TA sessions

- Optional: Make BDA3 exercises 1.1-1.4, 1.6-1.8 (model solutions available for 1.1-1.6)
- Start reading Chapters 1+2, see instructions below

BDA3 Chapters 1+2, basics of Bayesian inference, observation model, likelihood, posterior and binomial model, predictive distribution and benefit of integration, priors and prior information, and one parameter normal model.

- Read BDA3 Chapter 2
- Watch videos Lecture 2.1 and Lecture 2.2 on basics of Bayesian inference, observation model, likelihood, posterior and binomial model, predictive distribution and benefit of integration, priors and prior information, and one parameter normal model. BDA3 Ch 1+2.
- Optional summary videos:
- Read the additional comments for Chapter 2
**Q&A Monday 14.9. 14:15-16**- There may be additional videos recorded based on Q&A

- Check R demos or Python demos for Chapter 2
- Make and submit Assignment 2.
**Deadline Sunday 20.9. 23:59**- Rubric questions used in peergrading for Assignment 2
- Review Assignment 1 done by your peers before 23:59 16.9.
- Reflect on your feedback

- TA sessions Wednesday 16.9. 14-16, Thursday 17.9. 12-14, Friday 18.9. 10-12
- Optional: Make BDA3 exercises 2.1-2.5, 2.8, 2.9, 2.14, 2.17, 2.22 (model solutions available for 2.1-2.5, 2.7-2.13, 2.16, 2.17, 2.20, and 2.14 is in course slides)
- Start reading Chapter 3, see instructions below

Multiparameter models, joint, marginal and conditional distribution, normal model, bioassay example, grid sampling and grid evaluation. BDA3 Ch 3.

- Read BDA3 Chapter 3
- Watch Lecture 3 on multiparameter models, joint, marginal and conditional distribution, normal model, bioassay example, grid sampling and grid evaluation. BDA3 Ch 3.
- Read the additional comments for Chapter 3
**Q&A Monday 21.9. 14:15-16**- Check R demos or Python demos for Chapter 3
- Make and submit Assignment 3.
**Deadline Sunday 27.9. 23:59**- Rubric questions used in peergrading for Assignment 3
- Review Assignment 2 done by your peers before 23:59 23.9., and reflect on your feedback

- TA sessions Wednesday 23.9. 14-16, Thursday 24.9. 12-14, Friday 25.9. 10-12
- Optional: Make BDA3 exercises 3.2, 3.3, 3.9 (model solutions available for 3.1-3.3, 3.5, 3.9, 3.10)
- Start reading Chapter 10, see instructions below

Numerical issues, Monte Carlo, how many simulation draws are needed, how many digits to report, direct simulation, curse of dimensionality, rejection sampling, and importance sampling. BDA3 Ch 10.

- Read BDA3 Chapter 10
- Watch Lecture 4.1 on numerical issues, Monte Carlo, how many simulation draws are needed, how many digits to report, and Lecture 4.2 on direct simulation, curse of dimensionality, rejection sampling, and importance sampling. BDA3 Ch 10.
- Read the additional comments for Chapter 10
**Q&A Monday 28.9. 14:15-16**- Check R demos or Python demos for Chapter 10
- Make and submit Assignment 4.
**Deadline Sunday 4.10. 23:59**- Rubric questions used in peergrading for Assignment 4
- Review Assignment 3 done by your peers before 23:59 30.9., and reflect on your feedback

- TA sessions Wednesday 30.9. 14-16, Thursday 1.10. 12-14, Friday 2.10. 10-12
- Optional: Make BDA3 exercises 10.1, 10.2 (model solution available for 10.4)
- Start reading Chapter 11, see instructions below

Markov chain Monte Carlo, Gibbs sampling, Metropolis algorithm, warm-up, convergence diagnostics, R-hat, and effective sample size. BDA3 Ch 11.

- Read BDA3 Chapter 11
- Watch Lecture 5.1 on Markov chain Monte Carlo, Gibbs sampling, Metropolis algorithm, and Lecture 5.2 on warm-up, convergence diagnostics, R-hat, and effective sample size. BDA3 Ch 11.
- Read the additional comments for Chapter 11
**Q&A Monday 5.10. 14:15-16**- Check R demos or Python demos for Chapter 11
- Make and submit Assignment 5.
**Deadline Sunday 11.10. 23:59**- Rubric questions used in peergrading for Assignment 5
- Review Assignment 4 done by your peers before 23:59 7.10., and reflect on your feedback

- TA sessions Wednesday 7.10. 14-16, Thursday 8.10. 12-14, Friday 9.10. 10-12
- Optional: Make BDA3 exercise 11.1 (model solution available for 11.1)
- Start reading Chapter 12 + Stan material, see instructions below

HMC, NUTS, dynamic HMC and HMC specific convergence diagnostics, probabilistic programming and Stan. BDA3 Ch 12 + extra material

- Read BDA3 Chapter 12
- Watch Lecture 6.1 on HMC, NUTS, dynamic HMC and HMC specific convergence diagnostics, and Lecture 6.2 on probabilistic programming and Stan. BDA3 Ch 12 + extra material.
- Slides
- Optional: Stan Extra introduction recorded 2020 Golf putting example, main features of Stan, benefits of probabilistic programming, and comparison to some other software.

- Read the additional comments for Chapter 12
- Read Stan introduction article
**Q&A Monday 12.10. 14:15-16**- Check R demos for RStan or Python demos for PyStan
- Additional material for Stan:
- Documentation
- RStan installation
- PyStan installation
- Basics of Bayesian inference and Stan, Jonah Gabry & Lauren Kennedy Part 1 and Part 2

- Make and submit Assignment 6.
**Deadline Sunday 25.10. 23:59**(two weeks for this assignment)- Rubric questions used in peergrading for Assignment 6
- Review Assignment 5 done by your peers before 23:59 14.10., and reflect on your feedback

- TA sessions Wednesday 14.10. 14-16, Thursday 15.10. 12-14, Friday 16.10. 10-12, Wednesday 21.10. 14-16
- Start reading Chapter 5 + Stan material, see instructions below
- No Q&A session on exam week 19.10.

Hierarchical models and exchangeability. BDA3 Ch 5.

- Read BDA3 Chapter 5
- Watch Lecture 7.1 on hierarchical models, and Lecture 7.2 on exchangeability. BDA3 Ch 5.
- Read the additional comments for Chapter 5
**Q&A Monday 26.10. 14:15-16**- Check R demos or Python demos for Chapter 5
- Make and submit Assignment 7.
**Deadline Sunday 8.11. 23:59**(two weeks for this assignment)- Rubric questions used in peergrading for Assignment 7
- Review Assignment 6 done by your peers before 23:59 28.10., and reflect on your feedback

- TA sessions Wednesday 28.10. 14-16, Thursday 29.10. 12-14, Friday 30.10. 10-12
- Optional: Make BDA3 exercises 5.1 and 5.1 (model solution available for 5.3-5.5, 5.7-5.12)
- Start reading Chapters 6-7 and additional material, see instructions below.

Model checking and cross-validation.

- Read BDA3 Chapters 6 and 7 (skip 7.2 and 7.3)
- Read Visualization in Bayesian workflow
- more about workflow and examples of prior predictive checking and LOO-CV probability integral transformations

- Read Practical Bayesian model evaluation using leave-one-out cross-validation and WAIC (Journal link)
- replaces BDA3 Sections 7.2 and 7.3 on cross-validation

- Watch Lecture 8.1 on model checking, and Lecture 8.2 on cross-validation part 1. BDA3 Ch 6-7 + extra material.
- Read the additional comments for Chapter 6 and Chapter 7
**Q&A Monday 2.11. 14:15-16**- Check R demos or Python demos for Chapter 6
- Additional reading material
- No new assignment in this block
- Start the project work
- TA sessions Wednesday 4.11. 14-16, Thursday 5.11. 12-14, Friday 6.11. 10-12
- Optional: Make BDA3 exercise 6.1 (model solution available for 5.3-5.5, 5.7-5.12)

PSIS-LOO, K-fold-CV, model comparison and selection. Extra lecture on variable selection with projection predictive variable selection.

- Read Chapter 7 (no 7.2 and 7.3)
- Read Practical Bayesian model evaluation using leave-one-out cross-validation and WAIC (Journal link)
- replaces BDA3 Sections 7.2 and 7.3 on cross-validation

- Watch Lecture 9.1 PSIS-LOO and K-fold-CV.
- Optional: Lecture 9.2 model comparison and selection, and Lecture 9.3 extra lecture on variable selection with projection predictive variable selection. Extra material.
**Q&A Monday 9.11. 14:15-16**- Additional reading material
- Make and submit Assignment 8.
**Deadline Sunday 15.11. 23:59**- Rubric questions used in peergrading for Assignment 8
- Review Assignment 7 done by your peers before 23:59 11.11., and reflect on your feedback

- TA sessions Wednesday 11.11. 14-16, Thursday 12.11. 12-14, Friday 13.11. 10-12
- Start reading Chapter 9, see instructions below.

Decision analysis. BDA3 Ch 9.

- Read Chapter 9
- Watch Lecture 10.1 on decision analysis. BDA3 Ch 9.
- Project presentation info will be updated soon.
**Q&A Monday 16.11. 14:15-16**- Make and submit Assignment 9.
**Deadline Sunday 22.11. 23:59**- Rubric questions used in peergrading for Assignment 9
- Review Assignment 8 done by your peers before 23:59 18.11., and reflect on your feedback

- TA sessions Wednesday 18.11. 14-16, Thursday 19.11. 12-14, Friday 20.11. 10-12
- Start reading Chapter 4, see instructions below.

Normal approximation (Laplace approximation), and large sample theory and counter examples. BDA3 Ch 4.

- Read Chapter 4
- Watch Lecture 11.1 on normal approximation (Laplace approximation) and Lecture 11.2 on large sample theory and counter examples. BDA3 Ch 4.
**Q&A Monday 23.11. 14:15-16**- No new assignment. Work on project. TAs help with projects.
- Review Assignment 9 done by your peers before 23:59 25.11., and reflect on your feedback

- TA sessions Wednesday 25.11. 14-16, Thursday 26.11. 12-14, Friday 27.11. 10-12

Frequency evaluation of Bayesian methods, hypothesis testing and variable selection. Overview of modeling data collection, BDA3 Ch 8, linear models, BDA Ch 14-18, lasso, horseshoe and Gaussian processes, BDA3 Ch 21.

- These lectures are optional, but especially the lecture on hypothesis testing and variable selection is useful for project work.
- Watch Lecture 12.1 on frequency evaluation, hypothesis testing and variable selection and Lecture 12.2 overview of modeling data collection, BDA3 Ch 8, linear models, BDA Ch 14-18, lasso, horseshoe and Gaussian processes, BDA3 Ch 21.
**Q&A Monday 30.11. 14:15-16**- Work on project. TAs help with projects.
**Project deadline 6.12. 23:59** - TA sessions Wednesday 2.12. 14-16, Thursday 3.12. 10-14

- Project report deadline December 6 23:59 (submit to peergrade).
- Review project reports done by your peers before 9.12. 23:59, and reflect on your feedback

- Project presentations 14-18.12. (evaluation week on week 51)

We strongly recommend using R in the course as there are more packages for Stan and statistical analysis in R. If you are already fluent in Python, but not in R, then using Python may be easier, but it can still be more useful to learn also R. Unless you are already experienced and have figured out your preferred way to work with R, we recommend

- installing RStudio Desktop,
- or use RStudio remotely

See FAQ for frequently asked questions about R problems in this course. The demo codes provide useful starting points for all the assignments.

- For learning R programming basics
- For learning basic and advanced plotting using R

Sanasta “bayesilainen” esiintyy Suomessa muutamaa erilaista kirjoitustapaa. Muoto “bayesilainen” on muodostettu yleisen vieraskielisten nimien taivutussääntöjen mukaan: *“Jos nimi on kirjoitettuna takavokaalinen mutta äännettynä etuvokaalinen, kirjoitetaan päätteseen tavallisesti takavokaali etuvokaalin sijasta, esim. Birminghamissa, Thamesilla.” Terho Itkonen, Kieliopas, 6. painos, Kirjayhtymä, 1997.*