Messages
Thanks to all student for your efforts! Here is the exam text and suggested answers.
to bring precisely one sheet of handwritten notes (one side, not both sides) to the exam. You may fill the sheet with whatever information you like (and contrary to what I said in class today: you will be given all the probability density functions you should need, so you do not need to fill your sheet with density functions).
Some students have sought a correction to the assignment. Unfortunately I never made one (except on the blackboard), but Lars has kindly let me share his (near perfect) solution with everyone.
There will be an extra exercise session on Thursday 13th of December at 10:15. It will take place in room 108 in NHA. I have not gotten any emails about exercises you would like me to go through, so unless I hear something I will present the written exam from 2013. I have uploaded the text on the website, so please check it out.
- The last ordinary lecture is on Friday:
- In the first hour, PhD-student Simen Eide will tell us about Bayesian probabilistic matrix factorisation. Here are the slides from the talk.
- In the next two hours I will try to give a general overview of the entire course, with some emphasis on exam relevant topics.
- There will be an extra exercise session on Thursday 13th of December at 10:15. It will take place in room 108 in NHA (the same room as the lectures). It might last 2 or 3 hours depending on the number of questions. Come prepared! Please send me emails about which exercises you would like me to present (these may be exercises we have seen before, or others, for example from previous exams).
- The exam:
- Permitted aids: this is a *no book* exam, but each student is allowed to bring along precisely one sheet of handwritten notes (one side, not both sides). Also, please bring an approved calculator.
- Advice: on the exam you can expect questions of similar type as those that have been given for written exams in previous years. A natural start would b...
- Tomorrow:
- In the first hour, PhD-student Simon Brant will tell us about the Bayesian "cousins" of penalised regression methods, with emphasis on the Bayesian Lasso. Here are the slides from the talk.
- In the second hour I will discuss some points from the mandatory assignment.
- In the last hour we will go through exercises.
- Next week (23/11) we have the last lecture of the course. I will give an overview of the course and go through exercises.
- Currently, the preferred date for the extra exercise session is 13/12 (in the morning). Unless I hear strong protests, that date will be confirmed tomorrow.
- Check out...
As previously mentioned, I am organising an extra exercise session before the exam. It will take place at some time between the 10th and the 19th of December: please indicate in this doodle which dates are suitable for you. I hope we can settle on a date which is acceptable for all potential participants by the end of next week. Later, I will need you to suggest exercises you are interested in repeating (or even exercises we have not seen at all, for example from previous exams or Nils exercises).
Please check your results in devilry. I have tried to provide comments of interest to each of you (and I hope they are visible to you?). Please contact me if you find my comments unclear and/or confusing {and sorry for the bad spelling [no spellcheck in devilry apparently]}. I will discuss the answers to the assignment on the 16th of November (with emphasis on questions that were challenging). To those of you that have been asked to resubmit, remember the deadline is on the 16th of November at 09:00. Thank you everyone for your hard work. It was a pleasure to read through your submissions!
- Tomorrow:
- In the first hour I will lecture a bit about risk evaluation of estimators coming from the Empirical Bayes approach and we will also touch the Stein Paradox (check this nice "popular science" article if you are particularly curious).
- In the second hour we will go to the trial lecture of Aliaksandr Hubin, since the topic is relevant for the Bayes course.
- In the last hour we will go through exercises.
- Exercises:
- Nils exercise 2
- Nils exercise 12
- Exercise 3 from the exam in 2017 (4 hours exam)
- On Friday the 26th of October I discussed the rest of Chapter 5 (Hierarchical models) with particular emphasis on the Normal model which is the topic of Section 5.4. As last time, I spent some time on the Empirical Bayes solution in that setting. In addition, I used an extension of a similar hierarchical model as a demonstration of Gibbs sampling (the example in Section 11.6). See R-script giving code for the example that was discussed in the lecture. Exam Project 2015 exercise 2 was discussed, and served as another demonstration of hierarchical models (with geometrically distributed data).
- Next Friday I will continue with the last topic of the course Loss, Risk and a bit of decision theory. There will only be two hours of lecture/exercises next time, since I am giving a seminar talk at BI.
- Remember to hand in the Mandatory assignment!
- An extra exercise session: I propose...
- On Friday the 19th of October I discussed parts of Chapter 5 (Hierarchical models) with particular emphasis on the Beta-Binomial situation which is the topic of Section 5.3. I also spent some time on Empirical Bayes (which is a bit more present in the curriculum than in the book - see exercises). Exam Project 2015 exercise 3 was discussed (see R-script).
- Next Friday I will continue Chapter 5. If I have time, I will start with the last topic of the course Loss, Risk and a bit of decision theory.
- Check out R-scripts for Exam Project 2015 exercise 3 and for the "Rat tumor" example. The rat data are here.
- Exercise:
- Exam Project 2015 exercise 2. There are some subquestions here you have not learnt about yet (d and e): study them if you want, but we will come back to them later.
- Hint: In question 1 c) it is helpful to find the distribution of the variable (y/a)^b.
- Warning: if you use the build-in R functions for the Weibull distribution (for example rweibull) note that it is parameterised in "the opposite way" compared to the notation I've used in the assignment text. You can still use them of course, but just be careful that "a" in the assignment text is the "scale" parameter in R, and that "b" in the assignment text is the "shape" parameter in R.
- Typo: in question 2 d) there is a small typo, it should say \theta_0 = \exp(\alpha)/(1+\exp(\alpha)) [and not a].
- On Friday the 12th of October I spent a bit of time on the remaining details from Chapter 11 (assessing convergence), and some general comments concerning regression models. I also went through the exercises.
- On Friday I will discuss topics from Chapter 5 (Hierarchical models).
- Note the R-scripts for Nils exercise 23 h) and Exam project 2012 exercise 2.
- Remember to do the mandatory assignment!
- Exercise:
- Exam Project 2015 exercise 3. The data is given in the exercise.
is out! Find the assignment text and data in the column to the right. The deadline is Friday the 2nd of November. Please let me know if any of the questions are unclear.
The exam in the course will be a written exam. It will take place on the 19th of December.
- On Friday 5th of October Nils Lid Hjort lectured in my place. He spent most of the time on the exercises, with various details and general comments. He also said some words about regression models.
- Next Friday the lecture we will finish Chapter 11 (assessing convergence), and continue with regression models.
- Note the R-scripts (from Nils) for Nils exercise 22 b) and Exam project 2010 exercise 2.
- Exercises:
- Nils exercise 23 h) (but read through the rest of the exercise). Find data here.
- Exam Project 2012 exercise 2 (as much as you have time for). The data is given in the exercise.
- On Friday 28th of September we continued with MCMC topics: a bit of theory, and some specific version (Metropolis, Metropolis-Hastings and Gibbs).
- Next Friday the lecture will be held by Nils Lid Hjort in my place. He will discuss regression models (likely correlated with topics in 14.1 and 14.2) and go through exercises.
- Note the R-scripts from the "Monte Carlo exercise I" and the small "MCMC exercise". Also note the solution to "Monte Carlo exercise II" (see previous message).
- Exercises:
- Nils exercise 22 b) (an MCMC exercise)
- Exam project 2010 exercise 2 (this is a long exercise, partly difficult [especially g)], but do as much as you can). The data is here.
Since I discovered a mistake in my code while presenting the solution in class today, the whole exercise may have seemed a bit confusing. I have therefore posted a detailed solution to "Monte Carlo exercise II". In the document you will find R-code snippets for the three Monte Carlo methods you were asked to use, in addition to code for numerical integration and the "Lazy Bayes" strategy. You will also find the (hopefully correct) numbers, which you can compare with your own. The note can also be read as an example of various important topics in the course, many of which will be relevant for the mandatory exercise (especially sections 2, 5 and 7).
- On Friday 21th of September we started on the theme "Bayesian computation", specifically we went through parts of Chapter 10 (Importance and Rejection sampling) and started on Chapter 11 (MCMC). I also went through Nils Exercise 14 b) and the "Small mixture prior exercise".
- Next week we will continue with MCMC topics: a bit of theory, and some specific version (Metropolis, Metropolis-Hastings and Gibbs).
- Note the R-scripts from the "Small mixture prior exercise" and Nils Ex 9 e).
- Exercises:
- Monte Carlo exercise I: find some data (n=20 observations) here. Assume the data come from a normal distribution with unknown mean \theta and known variance (\sigma^2=1). Use a normal prior for \theta, N(\mu_0, \tau_0^2), with \mu_0=1 and \tau_0=1. Then we have an explicit posterior, with explicit expressions for all quantities of interest (her...
The mandatory assignment for STK4021/STK9021 will be uploaded on the course website around the 15th of October and the deadline will be on Thursday the 1st of November. The mandatory assignment needs to be approved before students are allowed to take the final exam (see general guidelines for mandatory assignments at UiO here).
Some students have inquired about written solutions to the exercises we discuss during the lectures. I have uploaded a solution to the Exam Project 2015 (which we discussed in previous weeks), but for the Nils exercises there are no written solutions available (and there never has been during the history of the Bayes course). However, for the R parts of the exercises I have uploaded R-scripts. Otherwise, you are always welcome to write me an email or visit my office (810) and I will be very happy to help you with any Bayes questions you may have.
The student representative for STK4021 is Lars Henry Berge Olsen - lholsen@student.matnat.uio.no.
If you have comments or criticism regarding the teaching and/or the course more generally, you may contact me, Céline, directly - but you can also approach the student representative.
- On Friday 14th of September we went through Chapter 4, with particular emphasis on the lazy Bayes (and half lazy Bayes) strategies. I also went through exercises with some details: the remaining parts of exercise 1 from exam project 2015, Nils Ex 13 e), f) and g) and Nils Ex 14 a). Nils Exercises 14 b) and 22 will be treated next time.
- Next week we will start discussing Bayesian Computation, the theme of Chapters 10 and 11.
- Note the three new R-scripts (on the right) which contains R-solutions for exercise 1 from exam project 2015 (a new version) and Nils Exercises 14 and 22.
- Exercises:
Small Mixture Prior exercise (coin flipping): you flip a coin n = 25 times and observe y = 10 Heads. Find the posterior density of theta = Pr(head), along with "standard summary numbers", namely posterior mean, posterior standard deviation, 0.05, 0.50, 0.95 post...
- On Friday 7th of September we went through Chapter 3, with particular emphasis on the univariate normal model and the multinomial model. I also discussed mixture priors (which comes up in Nils Ex 14 b) for next time).
- Next week we will go through Chapter 4. We will also go through some exercises (see below).
- Note that I have uploaded a new version of Nils Exercises where a few mistakes in Ex 13 have been corrected. There is still a typo in Ex 22 e) (a+n/2).
- Note the two new R-scripts (on the right) which contains R-solutions for the extension to exercise 2.10 (Cable cars) and for exercise 1 from exam project 2015.
- Exercises:
- Nils Exercise 13, about the Dirichlet-Multinomial. Do not use too much energy on questions a) and b), as I do not consider them as very central.
- Nils Exercise 14, applications of the Dirichlet-Multinomial. Question b) is difficult...