-
Notifications
You must be signed in to change notification settings - Fork 557
/
Aalto2023.Rmd
633 lines (559 loc) · 50.7 KB
/
Aalto2023.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
---
title: "Bayesian Data Analysis course - Aalto 2023"
date: "Page updated: `r format.Date(file.mtime('Aalto2023.Rmd'),'%Y-%m-%d')`"
editor_options:
markdown:
wrap: 72
params:
schedule_file: "schedule2023.csv"
project_dl: "3.12."
project_feedback_dl: "7.12."
project_presentations: "11.-15.12."
exam_week_lecture_date: "16.10."
---
```{r, echo=FALSE, results=FALSE}
Sys.setlocale("LC_TIME", "C")
schedule <- read.csv2(params$schedule_file, sep = "\t", header = FALSE, row.names = 1, col.names = paste("Week", 0:13, sep = ""))
# parse a date from the schedule. Google sheets format DD/MM/YYYY
sdate <- function(row, col, out_format = "%-d.%-m.", offset = 0) {
tidyr::replace_na(as.character(as.Date(schedule[row, col], format="%d/%m/%Y") + offset, format = out_format), schedule[row, col])
}
# return the string representation of the weekday of the scheduled day
sday <- function(row, col) {
weekdays(as.Date(schedule[row, col], format = "%d/%m/%Y"))
}
```
**Aalto 2023** course can be taken online except for the final project
presentation. The lectures will be given on campus, but recorded and the
recording will be made available online after the lecture. If you are
unable to register for the course at the moment in the Sisu, there is no
need to email the lecturer. You can start taking the course and register
before the end of the course. Sisu shows rooms on campus for the
computer exercises, and you can come to ask questions on campus, but
you can also ask in Zulip during the same times. You can choose which
TA session to join each week separately, without a need to register
for those sessions.
- [MyCourses](https://mycourses.aalto.fi/course/view.php?id=40722) is
used for initial announcements, linking to Zulip, peergrade, and some
questionnaires.
- Most of the communication happens in the course chat (see below)
- [Aalto University Code of Academic Integrity and Handling Violations
Thereof](https://www.aalto.fi/en/applications-instructions-and-guidelines/aalto-university-code-of-academic-integrity-and-handling-violations-thereof)
- Use of AI is allowed on the course, but the most of the work needs to be made by the student, and you need to report
whether you used AI and in which way you used them (See [points 5 and 6 in Aalto guidelines for use of AI in teaching](https://www.aalto.fi/en/services/guidance-for-the-use-of-artificial-intelligence-in-teaching-and-learning-at-aalto-university)). We have tested some AI on the course topics and assignments and the output can be copy of existing text without attribution (ie plagiarism), vague or have mistakes, so you need to be careful when using such outputs.
All the course material is available in a [git
repo](https://github.com/avehtari/BDA_course_Aalto) (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 the 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](https://github.com/avehtari/BDA_course_Aalto/archive/master.zip).
## Book: BDA3
::: {style="float:right;position: relative;"}
![](bda_cover.png)
:::
[The electronic version of the course book Bayesian Data Analysis, 3rd
ed, by Andrew Gelman, John Carlin, Hal Stern, David Dunson, Aki Vehtari,
and Donald Rubin](https://users.aalto.fi/~ave/BDA3.pdf) is available for
non-commercial purposes. Hard copies are available from [the
publisher](https://www.crcpress.com/Bayesian-Data-Analysis/Gelman-Carlin-Stern-Dunson-Vehtari-Rubin/p/book/9781439840955)
and many book stores. Aalto library has also copies. See also [home page
for the book](http://www.stat.columbia.edu/~gelman/book/), [errata for
the book](http://www.stat.columbia.edu/~gelman/book/errata_bda3.txt),
and [chapter notes](BDA3_notes.html).
## Prerequisites
- 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](http://math.aalto.fi/~lleskela/LectureNotes003.html)
- in English, see e.g. Wikipedia and [Introduction to probability
and
statistics](https://ocw.mit.edu/courses/mathematics/18-05-introduction-to-probability-and-statistics-spring-2014/readings/)
- Some algebra and calculus
- Basic visualisation techniques (R or Python)
- histogram, density plot, scatter plot
- see e.g. [BDA R demos](demos.html#BDA_R_demos)
- see e.g. [BDA Python demos](demos.html#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. The project brings together the overall Bayesian
workflow aspects.
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"](https://avehtari.github.io/ROS-Examples/).
- [Richard McElreath: Statistical Rethinking, 2nd
ed](https://xcelab.net/rm/statistical-rethinking/) 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](https://github.com/rmcelreath/statrethinking_winter2019) are
highly recommended even if you are following BDA3.
- [Johnson, Ott, and Dogucu: Bayes Rules! An Introduction to Applied
Bayesian Modeling](https://www.bayesrulesbook.com/)
- For background prerequisites some students have found chapters 2, 4
and 5 in [Kruschke, "Doing Bayesian Data
Analysis"](https://sites.google.com/site/doingbayesiandataanalysis/)
useful.
## Communication channels
- [MyCourses](https://mycourses.aalto.fi/course/view.php?id=40722) is
used for some intial announcements, linking to Zulip and Peergrade,
and some questionnaires.
- The primary communication channel is the Zulip course chat (link in
MyCourses, login with Aalto account)
- Don't ask via email or direct messages. By asking via common
streams 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 Zulip course chat. You can adjust the notifications in the settings.
- If you have any questions, please ask in the public streams 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 streams for each
assignment and the project.
- Stream **#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 stream).
- Any kind of feedback is welcome on stream **#feedback**.
- We have also streams **#r**, **#python**, and **#stan** for
questions that are not specific to assignments or the project.
- Stream **#queue** is used as a queue for getting help during [TA
sessions](assignments.html#TA_sessions).
- The lecturer and teaching assistants have names with "(staff)"
or "(TA)" in the end of their names.
- A weekly lecture time on campus includes times for questions and
answers
- If you need one-to-one help, please take part in the [TA
sessions](assignments.html#TA_sessions) and ask there.
- If you find errors in material, post in **#feedback** stream or
[submit an issue in
github](https://github.com/avehtari/BDA_course_Aalto/issues).
- 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.
## Assessment
[Assignments](assignments.html) (60%) and a [project work with
presentation](project.html) (40%). Minimum of 50% of points must be
obtained from both the assignments and project work. You can get
[bonus points](assignments.html#bonus) from chat activity (e.g. helping
other students and reporting typos in the material) and answering time
usage questionnaries.
## Schedule 2023
The course consists of 12 lectures, 9 assignments, a project work, and
a project presentation in periods I and II. It's good start reading
the material for the next lecture and assignment while making the
assignment related to the previous lecture. There are 9 assignments
and a project work with presentation, and thus the assignments are not
in one-to-one correspondence with the lectures. The schedule below
lists the lectures and how they connect to the topics, book chapters
and assignments.
### Schedule overview
Here is an overview of the schedule. Scroll down the page to see
detailed instructions for each block. When you are working on
assignment related to previous lecture, it is good to start reading
the book chapters relaed to the next lecture and assignment.
| | Readings | Lectures | Assignment | Lecture Date | Assignment due date |
|-----------|:----------|-----------|-----------|-----------|-----------|
| 1\. Introduction | [BDA3 Chapter 1](BDA3_notes.html#ch1) | [2023 Lecture 1.1 Introduction](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=5dde55e8-e2fe-4ccd-9019-b07300ba7620), <br> [2023 Lecture 1.2 Course practicalities](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=6b55e970-bc1c-4212-9f63-b07300c8414c), <br>[Slides 1.1](slides/BDA_lecture_1a.pdf),<br> [Slides 1.2](slides/BDA_lecture_1b.pdf) | [Assignment 1](assignments/assignment1.html) | `r sdate("Lecture date", "Week1")` | `r sdate("Assignment closes (23:59)", "Week1")` |
| 2\. Basics of Bayesian inference | [BDA3 Chapter 1](BDA3_notes.html#ch1), <br> [BDA3 Chapter 2](BDA3_notes.html#ch2) | [2023 Lecture 2.1](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=ed9cb7e6-a910-4afe-8659-b07a00bab594), <br> [2023 Lecture 2.2](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=48582af7-da3f-4798-ab0c-b07a00ca7aa2), <br>[Slides 2](slides/BDA_lecture_2.pdf) | [Assignment 2](assignments/assignment2.html) | `r sdate("Lecture date", "Week2")` | `r sdate("Assignment closes (23:59)", "Week2")` |
| 3\. Multidimensional posterior | [BDA3 Chapter 3](BDA3_notes.html#ch3) | [2023 Lecture 3.1](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=802abb82-07a2-4b4e-a16b-b0820089d994),<br> [2023 Lecture 3.2](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=c070e17c-ce4c-4a98-801c-b08200a5b22f)<br>[Slides 3](slides/BDA_lecture_3.pdf) | [Assignment 3](assignments/assignment3.html) | `r sdate("Lecture date", "Week3")` | `r sdate("Assignment closes (23:59)", "Week3")` |
| 4\. Monte Carlo | [BDA3 Chapter 10](BDA3_notes.html#ch10) | [2023 Lecture 4.1](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=d0a08786-0796-4e93-90a3-b08800b99601),<br> [2023 Lecture 4.2](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=ad034e33-56da-4255-9f3a-b08800cbe37e), <br>[Slides 4](slides/BDA_lecture_4.pdf) | [Assignment 4](assignments/assignment4.html) | `r sdate("Lecture date", "Week4")` | `r sdate("Assignment closes (23:59)", "Week4")` |
| 5\. Markov chain Monte Carlo | [BDA3 Chapter 11](BDA3_notes.html#ch11) | [2023 Lecture 5.1](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=279b3da6-efe6-44f7-b382-b08f00dd234b), <br> [2023 Lecture 5.2](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=ff3d41ef-b1cc-42b3-8544-b08f00ca25b2), <br>[Slides 5](slides/BDA_lecture_5.pdf) | [Assignment 5](assignments/assignment5.html) | `r sdate("Lecture date", "Week5")` | `r sdate("Assignment closes (23:59)", "Week5")` |
| 6\. Stan, HMC, PPL | [BDA3 Chapter 12](BDA3_notes.html#ch12) + [extra material on Stan](index.html#stan) | [2023 Lecture 6.1](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=80a36d3a-d67c-4534-a7ef-b09600b9f338), <br>[2023 Lecture 6.2](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=65bf5b2b-0a4e-4cae-ba26-b09600cb6222), <br>[Slides 6](slides/BDA_lecture_6.pdf) | [Assignment 6](assignments/assignment6.html) | `r sdate("Lecture date", "Week6")` | `r sdate("Assignment closes (23:59)", "Week6")` |
| 7\. Hierarchical models and exchangeability | [BDA3 Chapter 5](BDA3_notes.html#ch5) | [2023 Lecture 7.1](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=c1014690-1133-4232-ad0f-b0a400ba228d), <br> [2023 Lecture 7.2](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=196c3a91-3ba2-4469-ab15-b0a400ca6074),<br> [2022 Project info](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=8f0158f9-6abf-4ada-bdb7-af3800d139de), <br>[Slides 7](slides/BDA_lecture_7.pdf) | [Assignment 7](assignments/assignment7.html) | `r sdate("Lecture date", "Week8")` | `r sdate("Assignment closes (23:59)", "Week8")` |
| 8\. Model checking & cross-validation | [BDA3 Chapter 6](BDA3_notes.html#ch6), [BDA3 Chapter 7](BDA3_notes.html#ch7), [Visualization in Bayesian workflow](https://doi.org/10.1111/rssa.12378), [Practical Bayesian cross-validation](https://arxiv.org/abs/1507.04544) | [2023 Lecture 8.1](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=785ece8a-16ef-4f64-8134-b0ab00cbd1e8), <br> [2023 Lecture 8.2](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=456afda7-0e6d-4903-b0df-b0ab00da8f1e), <br>[Slides 8a](slides/BDA_lecture_8a.pdf),[Slides 8b](slides/BDA_lecture_8b.pdf) | Start project work | `r sdate("Lecture date", "Week9")` | `r sdate("Assignment closes (23:59)", "Week9")` |
| 9\. Model comparison, selection, and hypothesis testing | [BDA3 Chapter 7 (not 7.2 and 7.3)](BDA3_notes.html#ch7), <br> [Practical Bayesian cross-validation](https://arxiv.org/abs/1507.04544) | [2023 Lecture 9.1](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=a4961b5a-7e42-4603-8aaf-b0b200ca6295), <br> [2023 Lecture 9.2](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=a4796c79-eab2-436e-b55f-b0b200dac7ce), <br>[Slides 9](slides/BDA_lecture_9.pdf) | [Assignment 8](assignments/assignment8.html) | `r sdate("Lecture date", "Week10")` | `r sdate("Assignment closes (23:59)", "Week10")` |
| 10\. Decision analysis | [BDA3 Chapter 9](BDA3_notes.html#ch9) | [2023 Lecture 10.1](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=c4ab903a-bc22-416f-99c8-b0b900c9f3f7), [2023 Lecture 10.2](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=2a6d7c79-7797-4a6d-8efa-b0b900d8f24c), <br>[Slides 10a](slides/BDA_lecture_10a.pdf), [Slides 10b](slides/BDA_lecture_10b.pdf) | [Assignment 9](assignments/assignment9.html) | `r sdate("Lecture date", "Week11")` | `r sdate("Assignment closes (23:59)", "Week11")` |
| 11\. Variable selectio with projpred, project presentation example | [BDA3 Chapter 4](BDA3_notes.html#ch4) | [2023 Lecture 11.1](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=7ef70bc8-122b-4e86-80fa-b0c000cb5511), [2023 Lecture 11.2](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=a2b3bcb8-240e-4e6c-b90e-b0c000d92770), [2023 Lecture 11.3](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=ae634732-1f4e-4568-8529-b0c000e0f153), <br>[Slides 11a](slides/BDA_lecture_11a.pdf), [Slides Project Presentation](project_work/BDA_presentation_example.pdf), [Slides 11 extra](slides/slides_extra.pdf) | Project work | `r sdate("Lecture date", "Week12")` | `r sdate("Assignment closes (23:59)", "Week12")` |
| 12\. TBA | | Optional: <br> <br> <br> | Project work | `r sdate("Lecture date", "Week13")` | `r sdate("Assignment closes (23:59)", "Week13")` |
| 13\. Project evaluation | | | | Project presentations: `r params$project_presentations` | Evaluation week |
### 1) Course introduction, BDA 3 Ch 1, prerequisites assignment
Course practicalities, material, assignments, project work, peergrading,
QA sessions, TA sessions, prerequisites, chat, etc.
- Login with Aalto account to the Zulip course chat with link in MyCourses
- Signin to [Peergrade](https://www.peergrade.io) with link in MyCourses.
- Introduction/practicalities **lecture
`r paste(sday("Lecture date", "Week1"), sdate("Lecture date", "Week1"))`
14:15-16**, hall C, Otakaari 1\*\*<br>
- [2023 Lecture videos 1.1 and 1.2 in Panopto](https://aalto.cloud.panopto.eu/Panopto/Pages/Sessions/List.aspx?folderID=351877e5-230e-4d4a-8b64-b07300b81d0e)
- [Slides 1.1](slides/BDA_lecture_1a.pdf), [Slides 1.2](slides/BDA_lecture_1b.pdf)
- Read BDA3 Chapter 1
- start with [reading instructions for Chapter 1](BDA3_notes.html#ch1)
and afterwards read the additional comments in the same document
- There are no R/Python demos for Chapter 1
- Make and submit [Assignment 1](assignments/assignment1.html).
**Deadline
`r sday("Assignment closes (23:59)", "Week1")` `r sdate("Assignment closes (23:59)", "Week1")`
23:59**
- We highly recommend to submit all assignments Friday before 3pm
so that you can get TA help before submission. As the course has
students who work weekdays (e.g. FiTech students), the late
submission until Sunday night is allowed, but we can't provide
support during the weekends.
- this assignment checks that you have sufficient prerequisite
skills (basic probability calculus, and R or Python)
- [General information about assignments](assignments.html)
- [R markdown template for
assignments](https://github.com/avehtari/BDA_course_Aalto/tree/master/templates/)
- [FAQ for the assignments](FAQ.html) has solutions to
commonly asked questions related RStudio setup, errors
during package installations, etc.
- Get help in TA sessions
`r sdate("Lecture date", "Week1", offset = 2)` 14-16,
`r sdate("Lecture date", "Week1", offset = 3)` 12-14,
`r sdate("Lecture date", "Week1", offset = 4)` 10-12
- in Sisu these are marked as exercise sessions, but we call them
TA sessions
- these are optional and you can choose which one to join
- see more info about [TA sessions](assignments.html#TA_sessions)
- Optional: Make BDA3 exercises 1.1-1.4, 1.6-1.8 ([model solutions
available for
1.1-1.6](http://www.stat.columbia.edu/~gelman/book/solutions3.pdf))
- Start reading Chapters 1+2, see instructions below
### 2) BDA3 Ch 1+2, basics of Bayesian inference
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
- see [reading instructions for Chapter 2](BDA3_notes.html#ch2)
- **Lecture
`r paste(sday("Lecture date", "Week2"), sdate("Lecture date", "Week2"))`
14:15-16, hall T1, CS building**
- [Slides 2](slides/BDA_lecture_2.pdf)
- Videos: [2023 Lecture 2.1](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=ed9cb7e6-a910-4afe-8659-b07a00bab594), [2023 Lecture 2.2](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=48582af7-da3f-4798-ab0c-b07a00ca7aa2)
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.
- Read [the additional comments for Chapter 2](BDA3_notes.html#ch2)
- Check [R demos](demos.html#BDA_R_demos) or [Python
demos](demos.html#BDA_Python_demos) for Chapter 2
- Make and submit [Assignment 2](assignments/assignment2.html).
**Deadline
`r sday("Assignment closes (23:59)", "Week2")` `r sdate("Assignment closes (23:59)", "Week2")`
23:59**
- Review Assignment 1 done by your peers before 23:59
`r sdate("Feedback closes (23:59)", "Week1")`
- Reflect on your feedback
- [TA sessions](assignments.html#TA_sessions)
`r sdate("Lecture date", "Week2", offset = 2)` 12-14,
`r sdate("Lecture date", "Week2", offset = 3)` 12-14,
`r sdate("Lecture date", "Week2", offset = 4)` 12-14.
- 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](http://www.stat.columbia.edu/~gelman/book/solutions3.pdf), and
2.14 is in course slides)
- Start reading Chapter 3, see instructions below
### 3) BDA3 Ch 3, multidimensional posterior
Multiparameter models, joint, marginal and conditional distribution,
normal model, bioassay example, grid sampling and grid evaluation. BDA3
Ch 3.
- Read BDA3 Chapter 3
- see [reading instructions for Chapter 3](BDA3_notes.html#ch3)
- **Lecture
`r paste(sday("Lecture date", "Week3"), sdate("Lecture date", "Week3"))`.
14:15-16, hall T1, CS building**
- [Slides 3](slides/BDA_lecture_3.pdf)
- Videos: [2023 Lecture 3.1](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=802abb82-07a2-4b4e-a16b-b0820089d994) [2023 Lecture 3.2](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=c070e17c-ce4c-4a98-801c-b08200a5b22f) 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](BDA3_notes.html#ch3)
- Check [R demos](demos.html#BDA_R_demos) or [Python
demos](demos.html#BDA_Python_demos) for Chapter 3
- Make and submit [Assignment 3](assignments/assignment3.html).
**Deadline
`r sday("Assignment closes (23:59)", "Week3")` `r sdate("Assignment closes (23:59)", "Week3")`
23:59**
- Review Assignment 2 done by your peers before 23:59
`r sdate("Feedback closes (23:59)", "Week2")`, and reflect on
your feedback.
- [TA sessions](assignments.html#TA_sessions)
`r sdate("Lecture date", "Week3", offset = 2)` 12-14,
`r sdate("Lecture date", "Week3", offset = 3)` 12-14,
`r sdate("Lecture date", "Week3", offset = 4)` 12-14.
- Optional: Make BDA3 exercises 3.2, 3.3, 3.9 ([model solutions
available for 3.1-3.3, 3.5, 3.9,
3.10](http://www.stat.columbia.edu/~gelman/book/solutions3.pdf))
- Start reading Chapter 10, see instructions below
### 4) BDA3 Ch 10, Monte Carlo
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
- see [reading instructions for Chapter 10](BDA3_notes.html#ch10)
- **Lecture
`r paste(sday("Lecture date", "Week4"), sdate("Lecture date", "Week4"))`
14:15-16, hall T1, CS building**
- [Slides 4](slides/BDA_lecture_4.pdf)
- Videos: [2023 Lecture 4.1](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=d0a08786-0796-4e93-90a3-b08800b99601)
on numerical issues, Monte Carlo, how many simulation draws are
needed, how many digits to report, and [2023 Lecture 4.2](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=ad034e33-56da-4255-9f3a-b08800cbe37e)
on direct simulation, curse of dimensionality, rejection sampling,
and importance sampling. BDA3 Ch 10.
- Read [the additional comments for Chapter 10](BDA3_notes.html#ch10)
- Check [R demos](demos.html#BDA_R_demos) or [Python
demos](demos.html#BDA_Python_demos) for Chapter 10
- Make and submit [Assignment 4](assignments/assignment4.html).
**Deadline
`r sday("Assignment closes (23:59)", "Week4")` `r sdate("Assignment closes (23:59)", "Week4")`
23:59**
- Review Assignment 3 done by your peers before 23:59
`r sdate("Feedback closes (23:59)", "Week3")`, and reflect on
your feedback
- [TA sessions](assignments.html#TA_sessions)
`r sdate("Lecture date", "Week4", offset = 2)` 12-14,
`r sdate("Lecture date", "Week4", offset = 3)` 12-14,
`r sdate("Lecture date", "Week4", offset = 4)` 12-14.
- Optional: Make BDA3 exercises 10.1, 10.2 ([model solution available
for 10.4](http://www.stat.columbia.edu/~gelman/book/solutions3.pdf))
- Start reading Chapter 11, see instructions below
### 5) BDA3 Ch 11, Markov chain Monte Carlo
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
- see [reading instructions for Chapter 11](BDA3_notes.html#ch11)
- **Lecture
`r paste(sday("Lecture date", "Week5"), sdate("Lecture date", "Week5"))`
14:15-16, hall T1, CS building**
- [Slides 5](slides/BDA_lecture_5.pdf)
- Videos: [2023 Lecture 5.1](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=279b3da6-efe6-44f7-b382-b08f00dd234b) on Markov chain Monte Carlo, Gibbs sampling, Metropolis algorithm,
and [2023 Lecture 5.2](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=ff3d41ef-b1cc-42b3-8544-b08f00ca25b2)
on warm-up, convergence diagnostics, R-hat, and effective sample size.
- Read [the additional comments for Chapter 11](BDA3_notes.html#ch11)
- Check [R demos](demos.html#BDA_R_demos) or [Python
demos](demos.html#BDA_Python_demos) for Chapter 11
- Make and submit [Assignment 5](assignments/assignment5.html).
**Deadline
`r sday("Assignment closes (23:59)", "Week5")` `r sdate("Assignment closes (23:59)", "Week5")`
23:59**
- Review Assignment 4 done by your peers before 23:59
`r sdate("Feedback closes (23:59)", "Week4")`, and reflect on
your feedback
- [TA sessions](assignments.html#TA_sessions)
`r sdate("Lecture date", "Week5", offset = 2)` 12-14,
`r sdate("Lecture date", "Week5", offset = 3)` 12-14,
`r sdate("Lecture date", "Week5", offset = 4)` 12-14.
- Optional: Make BDA3 exercise 11.1 ([model solution available for
11.1](http://www.stat.columbia.edu/~gelman/book/solutions3.pdf))
- Start reading Chapter 12 + Stan material, see instructions below
### 6) BDA3 Ch 12 + Stan, HMC, PPL, Stan
HMC, NUTS, dynamic HMC and HMC specific convergence diagnostics,
probabilistic programming and Stan. BDA3 Ch 12 + [extra
material](index.html#stan)
- Read BDA3 Chapter 12
- see [reading instructions for Chapter 12](BDA3_notes.html#ch12)
- **Lecture
`r paste(sday("Lecture date", "Week6"), sdate("Lecture date", "Week6"))`
14:15-16, hall T1, CS building**
- [Slides 6](slides/BDA_lecture_6.pdf)
- Videos: [2022 Lecture 6.1](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=80a36d3a-d67c-4534-a7ef-b09600b9f338) on HMC, NUTS, dynamic HMC and HMC specific convergence diagnostics,
and [2022 Lecture 6.2](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=65bf5b2b-0a4e-4cae-ba26-b09600cb6222) on probabilistic programming and Stan. BDA3 Ch 12 + [extra
material](#stan).
- Optional: [Stan Extra introduction recorded
2020](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=f4b61f2a-4a94-43f7-828c-ac460144f64f)
Golf putting example, main features of Stan, benefits of
probabilistic programming, and comparison to some other
software.
- Read [the additional comments for Chapter
12](BDA3_notes.html#ch12)
- Read [Stan introduction
article](http://www.stat.columbia.edu/~gelman/research/published/Stan-paper-aug-2015.pdf)
- Check [R demos](demos.html#BDA_R_demos) for RStan or [Python
demos](demos.html#BDA_Python_demos) for PyStan
- Additional material for Stan:
- [Documentation](https://mc-stan.org/users/documentation/)
- [RStan
installation](https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started)
- [PyStan
installation](https://pystan.readthedocs.io/en/latest/getting_started.html)
- Basics of Bayesian inference and Stan, Jonah Gabry & Lauren
Kennedy [Part
1](https://www.youtube.com/watch?v=ZRpo41l02KQ&t=8s&list=PLuwyh42iHquU4hUBQs20hkBsKSMrp6H0J&index=6)
and [Part
2](https://www.youtube.com/watch?v=6cc4N1vT8pk&t=0s&list=PLuwyh42iHquU4hUBQs20hkBsKSMrp6H0J&index=7)
- Make and submit [Assignment 6](assignments/assignment6.html).
**Deadline`r sday("Assignment closes (23:59)", "Week6")` `r sdate("Assignment closes (23:59)", "Week6")` 23:59** (two weeks for this assignment)
- Review Assignment 5 done by your peers before 23:59
`r sdate("Feedback closes (23:59)", "Week5")`, and reflect on
your feedback
- [TA sessions](assignments.html#TA_sessions)
`r sdate("Lecture date", "Week6", offset = 2)` 14-16,
`r sdate("Lecture date", "Week6", offset = 3)` 12-14,
`r sdate("Lecture date", "Week6", offset = 4)` 10-12.
- Start reading Chapter 5 + Stan material, see instructions below
- No Lecture on evaluation week.
### 7) BDA3 Ch 5, hierarchical models
Hierarchical models and exchangeability. BDA3 Ch 5.
- Read BDA3 Chapter 5
- see [reading instructions for Chapter 5](BDA3_notes.html#ch5)
- **Lecture `r paste(sday("Lecture date", "Week8"), sdate("Lecture date", "Week8"))` 14:15-16, hall T2, CS building**
- [Slides 7](slides/BDA_lecture_7.pdf)
- Videos: [2023 Lecture 7.1](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=c1014690-1133-4232-ad0f-b0a400ba228d) on hierarchical models, [2023 Lecture 7.2](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=196c3a91-3ba2-4469-ab15-b0a400ca6074) on exchangeability.
- Read [the additional comments for Chapter 5](BDA3_notes.html#ch5)
- Check [R demos](demos.html#BDA_R_demos) or [Python
demos](demos.html#BDA_Python_demos) for Chapter 5
- Make and submit [Assignment 7](assignments/assignment7.html).
**Deadline
`r sday("Assignment closes (23:59)", "Week8")` `r sdate("Assignment closes (23:59)", "Week8")`
23:59** (two weeks for this assignment)
- Review Assignment 6 done by your peers before 23:59
`r sdate("Feedback closes (23:59)", "Week6")`, and reflect on
your feedback
- [TA sessions](assignments.html#TA_sessions)
`r sdate("Lecture date", "Week8", offset = 2)` 14-16,
`r sdate("Lecture date", "Week8", offset = 3)` 12-14,
`r sdate("Lecture date", "Week8", offset = 4)` 10-12.
- Optional: Make BDA3 exercises 5.1 and 5.2 ([model solution available
for 5.3-5.5,
5.7-5.12](http://www.stat.columbia.edu/~gelman/book/solutions3.pdf))
- Start reading Chapters 6-7 and additional material, see instructions
below.
### 8) BDA3 Ch 6+7 + extra material, model checking, cross-validation
Model checking and cross-validation.
- Read BDA3 Chapters 6 and 7 (skip 7.2 and 7.3)
- see [reading instructions for Chapter 6](BDA3_notes.html#ch6) and [Chapter 7](BDA3_notes.html#ch7)
- Read [Visualization in Bayesian
workflow](https://doi.org/10.1111/rssa.12378)
- 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](https://arxiv.org/abs/1507.04544)
([Journal link](https://doi.org/10.1007/s11222-016-9696-4))
- replaces BDA3 Sections 7.2 and 7.3 on cross-validation
- **Lecture `r paste(sday("Lecture date", "Week9"), sdate("Lecture date", "Week9"))` 14:15-16, hall T2, CS building**
- [Slides 8a](slides/BDA_lecture_8a.pdf), [Slides 8b](slides/BDA_lecture_8b.pdf)
- Videos: [2022 Lecture 8.1](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=785ece8a-16ef-4f64-8134-b0ab00cbd1e8) on model checking, and [2023 Lecture 8.2](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=456afda7-0e6d-4903-b0df-b0ab00da8f1e) on cross-validation part 1. BDA3 Ch 6-7 + extra material.
- Read [the additional comments for Chapter 6](BDA3_notes.html#ch6) and [Chapter 7](BDA3_notes.html#ch7)
- Check [R demos](demos.html#BDA_R_demos) or [Python
demos](demos.html#BDA_Python_demos) for Chapter 6
- Additional reading material
- [Cross-validation
FAQ](https://users.aalto.fi/~ave/CV-FAQ.html)
- No new assignment in this block
- Start [the project work](project.Rmd)
- [TA sessions](assignments.html#TA_sessions)
`r sdate("Lecture date", "Week9", offset = 2)` 14-16,
`r sdate("Lecture date", "Week9", offset = 3)` 12-14,
`r sdate("Lecture date", "Week9", offset = 4)` 10-12.
- Optional: Make BDA3 exercise 6.1 ([model solution available for
6.1, 6.5-6.7](http://www.stat.columbia.edu/~gelman/book/solutions3.pdf))
### 9) BDA3 Ch 7, extra material, model comparison and selection
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)
- see [reading instructions for Chapter 7](BDA3_notes.html#ch7)
- Read [Practical Bayesian model evaluation using leave-one-out
cross-validation and WAIC](https://arxiv.org/abs/1507.04544)
([Journal link](https://doi.org/10.1007/s11222-016-9696-4))
- replaces BDA3 Sections 7.2 and 7.3 on cross-validation
- **Lecture `r paste(sday("Lecture date", "Week10"), sdate("Lecture date", "Week10"))` 14:15-16, hall T2, CS building**
- [Slides 9](slides/BDA_lecture_9.pdf)
- Videos: [2023 Lecture 9.1](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=a4961b5a-7e42-4603-8aaf-b0b200ca6295) and [2023 Lecture 9.2](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=a4796c79-eab2-436e-b55f-b0b200dac7ce) on model comparison, selection, and hypothesis testing.
- Additional reading material
- [CV FAQ](https://users.aalto.fi/~ave/CV-FAQ.html)
- Make and submit [Assignment 8](assignments/assignment8.html).
**`r sday("Assignment closes (23:59)", "Week10")` `r sdate("Assignment closes (23:59)", "Week10")` 23:59**
- Review Assignment 7 done by your peers before 23:59
`r sdate("Feedback closes (23:59)", "Week8")`, and reflect on
your feedback
- [TA sessions](assignments.html#TA_sessions)
`r sdate("Lecture date", "Week10", offset = 2)` 14-16,
`r sdate("Lecture date", "Week10", offset = 3)` 12-14,
`r sdate("Lecture date", "Week10", offset = 4)` 10-12.
- Start reading Chapter 9, see instructions below.
### 10) BDA3 Ch 9, decision analysis + BDA3 Ch 4 Laplace approximation and asymptotics
Decision analysis. BDA3 Ch 9. + Laplace approximation and asymptotics. BDA Ch 4.
- Read Chapter 9 and 4
- see [reading instructions for Chapter 9](BDA3_notes.html#ch9)
- see [reading instructions for Chapter 4](BDA3_notes.html#ch4)
- **Lecture `r paste(sday("Lecture date", "Week11"), sdate("Lecture date", "Week11"))` 14:15-16, hall T2, CS building**
- [Slides 10a](slides/BDA_lecture_10a.pdf), [Slides 10b](slides/BDA_lecture_10b.pdf)
- Videos: [2023 Lecture 10.1](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=c4ab903a-bc22-416f-99c8-b0b900c9f3f7)
on decision analysis. BDA3 Ch 9, and [2023 Lecture 10.2](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=2a6d7c79-7797-4a6d-8efa-b0b900d8f24c) on Laplace approximation, and asymptotics, BDA3 Ch 4.
- Make and submit [Assignment 9](assignments/assignment9.html).
**`r sday("Assignment closes (23:59)", "Week11")` `r sdate("Assignment closes (23:59)", "Week11")` 23:59**
- Review Assignment 8 done by your peers before 23:59
`r sdate("Feedback closes (23:59)", "Week9")`, and reflect on
your feedback
- [TA sessions](assignments.html#TA_sessions)
`r sdate("Lecture date", "Week11", offset = 2)` 14-16,
`r sdate("Lecture date", "Week11", offset = 3)` 12-14,
`r sdate("Lecture date", "Week11", offset = 4)` 10-12.
- Start reading Chapter 4, see instructions below.
### 11) Variable selection with projpred, project presentation example, extra
- **Lecture `r paste(sday("Lecture date", "Week12"), sdate("Lecture date", "Week12"))` 14:15-16, hall T2, CS building**
- [Slides 11a](slides/BDA_lecture_11a.pdf), [Slides Project Presentation](project_work/BDA_presentation_example.pdf), [Slides 11 extra](slides/slides_extra.pdf)
- Videos: [2023 Lecture 11.1](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=7ef70bc8-122b-4e86-80fa-b0c000cb5511) on variable selecion with projpred, [2023 Lecture 11.2](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=a2b3bcb8-240e-4e6c-b90e-b0c000d92770) on project presentations, [2023 Lecture 11.3](https://aalto.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=ae634732-1f4e-4568-8529-b0c000e0f153) on rest of BDA3, ROS, and Bayesian Workflow
- No new assignment. Work on project. TAs help with projects.
- Review Assignment 9 done by your peers before 23:59
`r sdate("Feedback closes (23:59)", "Week10")`, and reflect on
your feedback
- [TA sessions](assignments.html#TA_sessions)
`r sdate("Lecture date", "Week12", offset = 2)` 14-16,
`r sdate("Lecture date", "Week12", offset = 3)` 12-14,
`r sdate("Lecture date", "Week12", offset = 4)` 10-12.
### 12) TBA
- **Lecture `r paste(sday("Lecture date", "Week13"), sdate("Lecture date", "Week13"))` 14:15-16, hall T2, CS building**
- [Slides 12](slides/BDA_lecture_12.pdf)
- TBA
- Work on project. TAs help with projects. **Project deadline
`r params$project_dl` 23:59**
- [TA sessions](assignments.html#TA_sessions)
`r sdate("Lecture date", "Week13", offset = 2)` 14-16,
`r sdate("Lecture date", "Week13", offset = 3)` 12-14,
`r sdate("Lecture date", "Week13", offset = 4)` 10-12.
### 13) Project evaluation
- Project report deadline `r params$project_dl` 23:59 (submit to
peergrade).
- Review project reports done by your peers before `r params$project_feedback_dl` 23:59, and reflect on your feedback.
- Project presentations `r params$project_presentations` (evaluation
week)
## R and Python
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
- [use RStudio remotely](FAQ.html#How_to_use_R_and_RStudio_remotely)
- [or install RStudio Desktop](https://posit.co/download/rstudio-desktop/),
See [FAQ](FAQ.html) for frequently asked questions about R problems in
this course. The [demo codes](demos.html) provide useful starting points
for all the assignments.
- For learning R programming basics
- [Garrett Grolemund, Hands-On Programming with
R](https://rstudio-education.github.io/hopr/)
- For learning basic and advanced plotting using R
- [Kieran Healy, Data Visualization - A practical
introduction](https://socviz.co/)
- [Antony Unwin, Graphical Data Analysis with
R](http://www.gradaanwr.net/)
## English-Finnish-English statistics dictionary
Excellent online English-Finnish-English statistics dictionary:
- [Juha Alho, Elja Arjas, Esa Läärä ja Pekka Pere (2023). Tilastotieteen sanasto. Suomen Tilastoseuran julkaisuja no. 8. 2. laitos. Suomen Tilastoseura. Helsinki. https://sanasto.tilastoseura.fi/](https://sanasto.tilastoseura.fi/)
Shorter English-Finnish dictionary for the terms specific for this course
- [Lyhyt englanti-suomi sanasto kurssin
termeistä](extra_reading/sanasto.pdf)
Sanasta "bayesilainen" esiintyy Suomessa muutamaa erilaista
kirjoitustapaa. Olen käyttänyt muotoa "bayesilainen", joka 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.*
Suomen tilastoseura sen sijaan suosittaa muotoa "bayseiläinen". Heidän
perustelunsa löytyy Tilastotieteen sanastosta (ks. linkki
yllä). Tilastotieteen sanaston verkkoversiossa on hakutoiminto, ja
PDF-versio sisältää käännösten perusteluita sekä hieman tilastotieteen
varhaista historiaa Suomessa.