- dr. R.P. Dwight <r.p.dwight@tudelft.nl>
*Part of the MSc Aerodynamics Track, TU Delft*

**Prerequisites:** a) a first course on probability/statistics (though we give a brief refresher in Week I), b) a first course in numerical analysis, and c) a familiarity with numerical solution of PDEs. In addition numerical exercises will be done in Python - some programming experience is necessary.

**Topics:** UQ is a broad heading, and we will cover specifically:

- Propagation of parametric uncertainty through simulation codes;
- Description of random functions with (Gaussian) processes;
- Stochastic inverse problems in the Bayesian framework;
- Numerical methods for high-dimensional propagation/inverse problems;
- Machine-learning as Bayesian inference.
- Validating computer codes with experimental data
- Assimilating experimental data and simulation into a single prediction

**Structure:** The course is normally taught in 7 weeks, structured as follows:

Week | Lectures | Exercise |
---|---|---|

0 | Introduction and motivation | (none) |

I | Probability refresher/fundamentals | (none) |

II | Polynomial stochastic methods | Tutorial 1: Basics |

III | Multi-dimensions & Sparse grids | Tutorial 2: Uncertainty in XFoil |

IV | Bayes & Gaussian-processes | Tutorial 3: Gaussian processes (Kriging) |

V | Bayes for nonlinear models | Tutorial 4: Inverse Poission problem (low-dimensional) |

VI | Variational methods with adjoints | Tutorial 5: Field inversion for Poission |

VII | Machine-learning as Bayesian inference | (none) |

For each part of the course there is a programming tutorial, in which the theory is applied. The exercises use Python in Jupyter notebooks. Each should take ~3-6 hours depending strongly on your programming (and Python/numpy) experience. There is also a more involved final project: "RANS model calibration", and should take a few days to complete.

- Week 0: Introduction and motivation
- Week I: Probability refresher/fundamentals
- Week II: Polynomial stochastic methods for propagation in 1d
**(Tutorial 1)** - Week III: Multiple dimensions & Sparse grids
**(Tutorial 2)** - Week IV: Bayes theorem & Gaussian-processes
**(Tutorial 3)** - Week V: Bayes for nonlinear models
**(Tutorial 4)** - Week VI: Variational methods for inverse problems with adjoints
**(Tutorial 5)** -
__Week VII__: Machine-learning as Bayesian inference

The five tutorials are in the form of IPython notebooks (with support files):

- Tutorials 1-2: Uncertainty propagation with polynomials, ipynb, xfoil.mat, xfoil.py
- Tutorial 3: Gaussian processes for surrogate modelling, ipynb
- Tutorial 4: Nonlinear inverse problems with McMC, ipynb
- Tutorial 5: High-dimensional inverse problems with adjoints, ipynb, secret.mat.

The tutorials make heavy use of `numpy`, which is the standard Python module for working with arrays, matrices, etc., and `scipy` which is the standard Python module for numerical and statistical primitives. If you have used Python, but not `numpy` before, then I strongly recommend reading:

- Numpy Quickstart Tutorial (and do the exercises!),
- Chapter 11 of the TU Delft reader of AE1205 Programming and Scientific Computing in Python.

- Tutorial 1 - Friday 18:00, Week 4.4
- Tutorial 2 - Friday 18:00, Week 4.5
- Tutorial 3 - Friday 18:00, Week 4.6
- Tutorial 4 - Friday 18:00, Week 4.7

To ensure easy access to a correctly setup Python environment for TU Delft students I've setup a server at: https://ipython.lr.tudelft.nl:8888. The port number is important!!! Your username is your NetID, and your password will appear in Brightspace GradeCenter. The notebooks are available in your home-directory. Moreover, on this server you can run the notebooks from within any browser, make modifications, plots, etc. Please just bear in mind that your code is not running locally, but on the server, which has limited capacity. So please don't perform long-running computations (or bitcoin mining!).

An (optional) final project is also available at final_project.zip. See the project description for an overview.In this course we use Ralph C. Smith's *Uncertainty quantification: Theory, implementation, and applications*, as a supporting text. Please find a copy before the course starts. We don't follow Smith closely, but if Smith covers the material, I will always reference the appropriate section below the corresponding video.

Additional texts for specific parts of the course are:

- On basic Bayesian statistics, Skilling & Sivia's
*Data Analysis: A Bayesian Tutorial*. - On advanced Bayesian statistics, Gelman's
*Bayesian Data Analysis*. - On inverse problems, Tarantola's
*Inverse problem theory*. - On surrogate modelling (especially Kriging) Forrester's,
*Engineering design via surrogate modelling*. - For an online UQ-programming course, see Bilionis's
*Introduction to UQ*.

- Bishop's
*Pattern recognition and Machine Learning*, - David Barber's
*Bayesian reasoning and machine learning*, - or Kevin Patrick Murphy's
*Machine Learning: a Probabilistic Perspective*.

- 15:45 Tue 4th May - Recording
- 15:45 Wed 11th May - Recording
- 15:45 Tue 18th May - Recording
- 15:45 Tue 25th May - Recording 1, Recording 2
- 15:45 Tue 1st June - Recording
- 15:45 Tue 8th June - Recording

- 50% 5 weekly tutorials (code only, pass/fail)
**OR**1 final project (graded report) - 50% oral exam

Usually tutorials are due the following week (and I strongly recommend that cadence, to keep up with the material). However this year (2021) there is a touch of disruption to schedules in Q4, therefore tutorials may be sumbitted any time. You may only schedule your oral once all tutorials are submitted.

I've received from lecturers, a few requests for tips on how to make the kind of maths videos seen e.g. here. Since my lectures are quite maths-heavy, I took inspiration on style from Khan academy. I'm using Linux (Ubuntu), but for most of the software below there are Windows/MacOS versions.

Finding a setup that works well was quite a lot of effort, you'll need:

- A tablet - I'm using an old Wacom Bamboo that I inherited from our department secretary.
- A good quality microphone - I'm using the Blue Yeti.
- Drawing/doodling software.
- Screen recording software.
- Video editing software.

For drawing I just tried a few until I found one I liked. I looked for ones with customizable backgrounds (I wanted black), and keyboard-shortcuts for changing pen, erasing, etc., and found:

**Write**- http://www.styluslabs.com (has Windows/Mac versions too) setup for the math expositions,**Xournal**- http://xournal.sourceforge.net (Linux only, supposedly similar to Windows "Journal") when I want to write on top of slides (it lets you load a background pdf).

My screenrecorder, the only requirement is that it works. Having a keyboard shortcut for starting and stopping saves time editing off the beginning and ends of the videos:

**SimpleScreenRecorder**- https://www.maartenbaert.be/simplescreenrecorder (Linux only, but plenty of such software exists on other OSes).

And only after a lot of searching did I find an editor that worked well (some deleted sound, some cut at the wrong place, one took ~1 hour to save a video, all sorts of problems). This one is fine for cutting and combining videos, which is all I need:

**LossLessCut**- https://github.com/mifi/lossless-cut (also Windows/Mac).

A special thanks to the developers of all these tools - this wouldn't have been possible without you!!!