Messages
I add in this now, grundig a posteriori, but I did mention a couple of times during the course the importance of *building loss functions*, for getting the Bayesian machinery to work -- and then I was reminded of Dag Jansson's diplomoppgave, 1981, entitled "Dynamisk risikoanalyse: Kvantitativ analyse av operasjonelle beslutninger ved offshore leteboring etter olje og gass med spesiell vekt p? v?ret som risikofaktor". I've now placed a pdf of that diplomoppgave at the course site, autumn 2021, also as a way of tracking it down later on.
That work is not Bayesian, per se, but I do admire its spirit when it comes to taking on board the various risks and potential influences, comparing apples to oranges and lives of birds to kroner and ?re, etc. -- which is an example of serious loss function construction. No, it isn't pensum, but something to behold and to ponder, for serious Bayesians, wishing to apply the course's Master Theorem in dire straits.
Geir Storvik gave this course in the autumn 2020 semester, and he has posted solutions to several exercises -- from the BDA3, from Nils Exercises, and to a couple of earlier exam set questions. Check the 2020 course site:
/studier/emner/matnat/math/STK4021/h20/exercises/
Jeg ser et par minutter av NRKs Debatten, 11.11.2021, som handler om spr?k ved universitetene. Jeg foreleser p? godt skoleengelsk, l?reboken og mine oppgaver er p? engelsk, men som flagget i Obligen er det (naturligvis) lov ? levere p? bokm?l, nynorsk, riksm?l (eller latin, eller dansk, eller svensk).
Det er fullstendig i orden at de fleste av de norske studentene leverte p? engelsk!, og det samme for de som ikke er norske men som kan norsk, s? dette er ingen klage over dette -- men jeg tillater meg ? h?pe at det norske spr?k ikke blir borte, i de mange internasjonale fag p? UiO og ellers. *Og* man er, naturligvis, meget velkommen til ? levere eksamensbesvarelsene p? norsk (selv om oppgavetekstene kommer til ? v?re p? engelsk). Dette gjelder ogs? de som tilfeldigvis ikke er norske, men som behersker spr?ket godt nok.
1. We've been through most of 4-hour Exam stk 4021 from 2017, but I will do just a bit more on Wed Nov 17.
2. Do Exercise 2, Exam project stk 4020 from 2012, about the gamma regression with (x_i, y_i). This may be seen as a prototype exercise for most of the themes of Ch 14.
3. Then we do as much as we can with 4-hour Exam stk 4021 from 2013 (another Nils Exam set).
4. Do a follow-up for the Exam stk 4021 blood group data, with counts 212, 103, 39, 148 for blood groups A, B, AB, O (for "ohne"). That exercise as about Theory Two Loci, with probabilities
p(1-q), (1-p)q, pq, (1-p)(1-q)
for the four groups -- and it is found to be wrong (!). Now do the similar thing for Theory One Locus (please do your Latin conjugations correctly), with probabilities
p(2-p-2q), q(2-2p-q), 2pq, (1-p-q)^2,
with (p,q) different from in Theory Two Loci, and with p + q < 1....
Thanks for your considerable efforts, everyone. I've been through the details of I believe N = 28 Oblig reports, and given feedback to all, via the Canvas system. My job has been to sort you into categories
One (fully accepted), Two (some good efforts, but not yet fully accepted), Three (not at the required level)
and can report that there are *zero reports* in this third category. Those in Category Two are given *one more week* to repair and extend their reports, and then submit these updated versions via the Canvas system, within Monday Nov 15, before 15:59. You should all be fully able to do this, to the level required for acceptance. I believe I've indicated for each the basics of what needs to be done.
I will have something more to say about the Oblig work this Wednesday Nov 10, but will not give all details, so to speak, since a subset of you are still on the case.
For the remaining weeks we'll be prepping ...
Course material: the BDA3 book, i.e. Gelman et al., and the Nils Exercises and Lecture Notes 2021 collection.
From BDA3: essentially, Chapters 1, 2, 3 (intro things, up to general parametrics), 4 (some simple large-sample approximations, Lazy Bayes approximation), 5 (hierarchical setups, inference for an ensemle of parameters), 10, 11 (computation, simulation, basic MCMC), 14 (regression).
From Nils collection: all exercises we've done during the course are considered pensum!, this applies also to earlier Exam set exercises, to "Nils Extra" given in the course messages, and the Oblig.
Kursorisk pensum, cursory curriculum, i.e. material you are supposed to know about, with a cursory reading through, etc., though not of the highest exam relevance:
Nils LH FocuStat Blog Posts:
The Magic Square of 33;
Sudoku Solving by Probability Models and Markov Chains;
Overdispersed Children;
...1. Thanks for your considerable efforts with the Oblig -- I've received 27 reports by the deadline yesterday Nov 2, with 2 or 3 more to come.
2. Today, Wed Nov 3, I went though *some* of the salient points of the Oblig, with the rest to be discussed next week. I hope to be able to all the reading & sorting & correcting over the coming few days -- sorting reports into Categories A (accepted), B (not yet accepted, with students allowed to try more for 4-5 days), C (not accepted).
3. I'll upload a few more R scripts by tomorrow, e.g. com108c for the "Chapter 5 prototype exercise", with n = 40 Poisson parameters.
4. Check the course site, to the left, under Oppgaver, and you'll find some earlier Exam Sets for our course. Find in particular the Exam Sets from December 2013 and from December 2017, both with Nils Lid Hjort.
For Wed Nov 10, do as much as you can from the 2017 set.
5. Next ...
1. Nils gives a seminar Tue Nov 2 at 14:15, 8th floor, on kortstokkproblemet -- it's not at the outset Bayesian, but with a prior on the number of unseen species in the forest we're in business:
https://www.mn.uio.no/math/english/research/groups/statistics-data-science/events/seminars/Nils%20Lid%20Hjort.html
2. From stk 9021 student Dennis Christensen: Summer job oppportunity at FFI
Hopefully you are all finishing up your obligs for tomorrow's deadline. I wish to inform you of a summer job opportunity at the Norwegian Defence Research Establishment (FFI), working with statistical analysis of the sensitivity of explosives. This is mathematically equivalent to the setup in exercise 4 in the oblig (usually called bio-assay or current status data), and will serve as an introduction to Bayesian nonparametrics and inference with censored data. *The deadline for applying is November 15*. If you are interested in applying, please click ...
Thanks to Diligent Dennis, who spotted an error in the Oblig's *figure*, the Rats exercise. I've now uploaded a corrected pdf for the Oblig. -- Again, this concerns only the figure, not numbers, and, actually, only the raw data y/m, not the curves.
1. Due to hitches & glitches in the Bureacracy of Things, it's possible that there will be only Exam Part One, the 4-hour no-book exam on Nov 30, i.e. no Exam Part Two, the intended home project. Apologies for this not being crystal clear from day zero. A final message regarding this will be given next week.
2. Make The Oblig your priority, with submission deadline Tue Nov 2. I shall have time to skim through your reports so that I can say something about them on Wed Nov 3.
3. I hope you have time to work through the following "prototype exercise for Chapter 5 terrain", which we'll do before we take the Exam stk 4020 2012 no. 3, which is of the same type, but with more complexities involved.
These are your n = 40 data points, sorted here from small to big:
0 2 2 3 3 3 3 3 3 3
4 4 5 5 5 5 5 6 6 6...
1. The OBLIG is out and needs to be your priority; reports are to be delivered, via the Canvas system of things, within Tue Nov 2.
2. On Wed Oct 20 we went through various MCMC matters, with Metropolis, briefly Metropolis-Hastings, and saw it applied for fnding magic squares (!); see my script com100d, and play with it, to construct yet further squares with yet further magical patterns. We also discussed Ch 5 hierarchical setups.
3. For Wed Oct 27 we do Exam stk4020 2008, Exercise 3, with joint inference for an ensemble of unifomity parameters.
I've said earlier that the OBLIG, the compulsory set of exercises, was planned from t0 = Wed Oct 20 to t1 = Mon Nov 1. I've now gently revised these dates, from t0' = Tue Oct 19 to t1' = Tue Nov 2. You'll find the Oblig here at the course site.
You need to submit your solutions via the Canvas system, within Tue Nov 2 at 13:55 norsk tid, by uploading pdfs.
I shall have time to skim through your solutions, in the course of the Tue Nov 2, so that I can tell you something about their quality, which points have been harder than others, etc., on Wed Nov 3. Sorting your solutions into "accepted" or "not yet accepted" will take a few days, however (and I hope to give each of you some constructive comments).
We'll also go through the exercises in class.
1. Nils has "office hours" Mondays 14:15 to 15:30, where you might knock on his door to have conversations about stk 4021 (apart from Mon Oct 18, due to a certain statistics seminar).
2. On Wed Oct 13 we rounded off Ch 4, with the Old Egypt lifelengths data exercise, using the Weibull model, with (a_m, b_m) for men and (a_w, b_w) for women, etc. We then jumped to Chapters 10, 11, with MCMC, and the Metropolis algorithm.
3. I've placed R scripts com39a (old Egypt) and com41a (generic Metropolis MCMC) at the website; check them, run them, play with other questions and setups.
4. The Oblig is made available at t_0 = Tue Oct 19, with your reports to be handed in at t_1 = Tue Nov 2.
5. For Wed Oct 20, do the following exercises.
(i) Construct a model p(x) for all 4 x 4 squares x, with numbers 1, 2, ..., 15, 16, of the form p(x) = c \exp(-\lambda Q(x)), where Q(x) = |sum_1 - 34| + ... + |sum_{10} - 34|, with 4 ro...
1. On Wed Oct 6 we discussed Nils Exercises 22, 23, with the gamma-normal prior setups for nornal data and for normal linear regression. I've uploaded R scripts com37a and com38a for these analyses, with x = cigarette consumption and y = lung cancer death rates per 100,000 people. You should carry out similar analyses for the other y given in the cigarette consumption dataset.
2. We went through the essence of Ch 4, with emphasis on "the lazy Bayesian" recipe: use \theta given data approximately distributed as N_p(\hat\theta_\ml, \hat J_\total^{-1}), with the ML estimator and the inverse information matrix, \hat J_\total being minus the 2nd derivate matrix of the log-lik function computed at the ML.
3. Let y_1, ..., y_n come from a Poisson (\theta), with \theta having a Gamma(a,b) prior. Find the exact posterior, and compare with the "lazy Bayesian" normal approximation.
4. I've uploaded "egypt_data", life-lengths for 82 men and 59 women, f...
1. I've uploaded the R script com32b, for the Gott würfelt nicht Nils Exercise 14(b); use it, run it, play with the tweaking parameters, understand precisely what goes on. More R scripts will be uploaded next week, also for the cigarette consumption data, for Nils Exercises 22, 23.
2. On the *cursory curriculum list*: the Nlis Lid Hjort FocuStat blog post on overdispersed (and even Markovian) children. WIthout using such terms, parts of this story relate to "p given data" and to Bayesian marginal probability calculations.
https://www.mn.uio.no/math/english/research/projects/focustat/the-focustat-blog%21/overdispersion.html
1. On Wed Sep 29, we rounded off Ch 3, with material from Nils Exercise 22, which replaces the corresponding parts of BDA Ch 3 for the normal model. We briefly started Ch 4, which will be concluded next week. After that we'll be MCMCing for a little while.
2. The Oblig, the Compulsory Exercises set, will be made available at t_0 = Wed Oct 20, with solutions to be handed in at t_1 = Mon Nov 1. -- Check the Oblig for the autumn semester 2018, made by Celine Cunen, with the French presidents. I've not yet decided on this year's Oblig, but I may choose to give you either that Oblig of 2018, or something with the same data, similar questions, but different models.
3. More information about *the exam* comes soon, in a separate message. For the four-hour written examination, Tue Nov 30, each student can bring along *one page of her or his handwritten notes*, but not the book.
4. Exercises for Wed Oct 6: all the practicalities from Nils Exercises 2...
1. On Wed Sep 22, we went through parts of Ch 3, including the Dirichlet and multinomial, and a bit on the Jeffreys priors. We also did certain exercises, namely Nils 14a Gott würfelt nicht; Nils extra with binormal (a,b) given (x,y); and Ch 3 Exercises 2. Next week we round of Ch 3 and start Ch 4. After that we dive into MCMCs.
2. I've uploaded R scripts com32a (Gott würfelt nicht) and com34a (the extra thing with binormal prior and binormal data). I've not attempted to streamline or polish com34a, so it's a direct "I do this and then I do that" type script. Note the matrix things in R, including solve(A) for the inverse and A %*% B for multiplication.
3. We elected two volunteers, student representatives; see separate message.
4. Exercises for Wed Sep 29: Nils Exercise 14b (more to do than with 14a); 22 (which replaces corresponding material from Ch 3, since my setup and formulae are more transparent); 6; and BDA Ch 3 Exercises 4, 7.
* Tharmira Santhirakumar, tharmirs@math.uio.no
* Leif-M.S. Sunde, lmsunde@math.uio.no
These are our volunteers, student representatives, and messages from all you others can be given to me via them, and vice versa (!). It's simplest and encouraged, however, to approach and ask me directly, if you have questions or concerns about the course.
Nils LH
1. On Wed Sep 15 we rounded off Ch 2, and started gently on Ch 3. We also went through extra exercises (i), (ii), (iii), (iv), and learned more about marginal distributions, predicitive distributions, the multinormal distribution, the Jeffreys prior, etc.
2. Nils Exercise 9 is defined as ten-minute curriculum about the multinormal distribution, with formulas for conditional distributions; these will be used in various setups later in the course.
3. Exercises for Wed Sep 22:
(i) Suppose (a,b) are unknown parameters, with a binormal prior, with prior means (a_0,b_0) = (3.0, 2.0), prior standard deviations (1,0.5), and prior correlation 0.66. What is the prior probability that a > b? Then we observe (x,y), which for given (a,b) is a binormal with mean (a,b), variances 1, 1, and correlation 0.33. With (x,y) = (2.77, 2.33), find the posterior distribution for (a,b). What is now the probability that a > b?
(ii) Nils Exercise 14,...
1. On Wed Sep 8 we did Nils Exercise 12 and the book's 2.9, 2.10, with various related comments and extensions. I've uploaded R scripts com25b, street cars of San Francisco, and com27a, alarm or no alarm. Play with the code, tweak parameters, etc., to learn more. In particular, you should *invent your own prior* for the street cars exercise, to see how that affects the results.
2. We also discussed material from Ch 2, with more on binomial-beta and normal-normal setups. Next week we round off Ch 2 and start on Ch 3.
3. Exercises for Wed Sep 15:
(i) Go back to Nils Exercise 1, where I gave 10 data points for a Poisson. Find the distribution of the not-yet-seen data point 11. Give a 90 percent credibility interval for that data point.
(ii) A modern reader of Bayes's original publication can ask and check some follow-up points. Here's one. Imagine 10^4 people getting their 10^4 coins from the local coin factor...
1. On Wed Sep 1 we did Nils Exercises 1, 2, with the Master Recipe, and the book's 2.10. We also went through general aspects of Bayesian setups, loss functions, the prior to posterior computations, etc., correlated with the first half of Ch 2.
2. I will place my simple R programme "com26a" on the website, for Nils Exercise 1. Play a bit with the parameters (a,b) of the gamma prior, and be sure to include a "silly prior"; play also with n, the number of data points.
3. Election day is September 13. I gave this course in 2017, but was away for one day. My PhD student Emil Stoltenberg was vikar in loco parentis for me that day, and used the occasion to write up and teach from the interesting note "Emil Stoltenberg 7-Sep-2017 predicts 11-Sep-2017 elections", available at the course website. It uses only Ch 2 methods, but there's a certain amount of Bayesian work to get the posterior going. It's also instructive for applications in fr...
1. On Wed Aug 24 we started the course! A few more students will show up for next week, I'm told. We use Auditorium 4, and as long as the korona rules allow us to, I'll be using the full length of the two greenboards, with a modicum of real-time real-life interaction with the students, etc. -- which means that there will be no zooming.
2. There will however be notes and pointers and small summaries, published here at the course website. So it's possible, but not nearly as fun, to follow the course without being old-school physically present. The "Nils Collection, Version A" is placed there, and there will be Versions B, C later on.
3. On this first day we went through various practicalities, and I gave a broad introduction to the Bayesian themes in general and the course in particular. These themes and thoughts will by definition follow us through the course, with variations.
4. For Wed Sep 1...
This is a 2nd "welcome to the course" message; be sure to read the previous one too. Our time slot is Wednesdays, 9:15 to 12:00, in Auditorium 4, Vilhelm Bjerknes Building, and we start out Aug 25.
Usually the 3 Blindern hours (45 minutes with 15 minutes breaks) will be structured in a 2 hour lecture + 1 hour exercises format, but there will be exceptions, depending on how various themes progress. On this first day there will be no exercises, and we might not use the full 3 hours.
I've placed a set of Exercises & Lecture Notes on the course site; please print them out for your work. These are partly based on previous occasions, and they will be extended further during this semester of teaching. Exercises during the course will be taken both from this "Nils Collection" and from the book, the BDA3.
We'll start with an attempt at a general overview, of Bayesian themes, pointing to practicalities, etc., and after a somewhat quick going-thro...
If the infection rate reaches a level where parts of society are forced to close down again during the autumn semester, written examination in this course may be conducted as a written home exam or as an oral examination.
It's still May, so rather early, but since I've just filled in certain forms regarding *the course book*, I use the occasion to say hello & welcome. There'll be more information here when we're drawing closer to mid August.
The likely time slot is Wednesdays 9-12 (2 hr lecturing + 1 hr going through exercises will be the intended division of labour), starting August 25.
The course book is Andrew Gelman et al., Bayesian Data Analysis, 3rd Edition (the so-called BDA3, from 2014), CRC Press. It will be available in Akademika, in due time. The book also has a webpage; check it.
Nils Lid Hjort