Principles of Programming in Econometrics
Principles of Programming in Econometrics is a bootcamp course intended for beginning QRM and TI/BDS PhD students, aspiring to flavour their research with their own coding. The course is build around material collected over the years, around either the Ox, Matlab, and nowadays Python languages.
TopicsTopics covered within the course are
- Structure of coding (where do I start)
- Structure of a program (how do I build in robustness)
- Concepts of variables/functions (what do I program)
- What is a number, should I care for rounding errors (what could go wrong)
- Optimisation and solving (non-)linear equations (how do I find the answer)
- and further matters...
In 2023, the course will be limited to four afternoons, from Tuesday August 29-Friday September 1 (13-16.30/17.00h)
at the IN-2B42 2B56 room at the Initium building of the Vrije Universiteit Amsterdam at the
These afternoons, both the teacher and several teaching assistants will help you move through the material. However, the material needs time for practice, hence you will not escape starting on time, several weeks earlier, such that you can use the supervision more intensely.
The table below lists the topics, explanatory video's, and practice material. Try to work through the material as far as you can, e.g. at least until the optimisation topics.
At this Google Doc, please sign up for the course, leaving your email address and some basic info on your previous programming experience.
Optionally, if you finish the material, feel free to try out one of the exercises from the download material. If you try them, make a good effort of getting clean, robust code following the rules of the course... And then send me your result by email, in a zip-file containing code + data + short explanation in .txt or .pdf. Then I will try to eventually take a look at it.
- Course slides
- Exercise slides
- Full zip of course material
- fill.zip for one of the exercises
- e0_elim.zip with backsubstitution
- sa0.zip with pandas example
- Optional Exercise GARCH-ML
- Optional Exercise Binary Tree
Questions & answersAt Q&A I'll post a page with questions and answers, as they come up. Later, the questions and answers will move to Canvas.
2023/8/29: Added optional exercises
2023/8/22: Moving to Tinbergen Institute instead of VU
2023/7/29: Cleaned out the page for 2023
|Day 0: Introduction||1-1||Vid|
|Exercise E0||(read/answer these questions now)||code|
|Example 2^8, syntax||12-23||Vid 1 (33:50), Vid 2 (16:23)||pynb d0p1|
|(Hungarian) Notation, variable names||24-32||Vid (23:08)||pynb d0p3_secret|
|Recap, review syntax||33-54||Vid (47:52)||pynb d0p2_backsubstitution|
|Day 1: Intro||60-61||Vid (9:59)|
|Theory: Planning programs||62-74||Vid (32:03)||pynb d1p2_fill|
|Concepts: Data, variables, functions, actions||75-91||Vid (39:47)||pynb d1p1_olsgen|
|View versus copy, scope||92-101||Vid (33:43)|
|Day 2: Preview||102-103||To add?|
|Flow: Coherent structure for the program||111-114||Vid (13:59)|
|Precision: Floating point numbers and rounding errors||115-123||Vid (25:13)|
|Do's and dont's: Practical advice||124-125||Vid (13:12)||pynb d2p2_olsgen2|
|Import: Importing packages and routines||126-128||Vid (12:05)|
|Graphs: Plotting in python||129-136||Vid (14:19)||pynb d2p4_graphs|
|Pandas: Data analytics/handling||137-151||Vid (41:57)||pynb d2p3_pandas|
|Day 3: Newton-Raphson Optimisation||152-166||Vid (32:20)|
|Minimize: Likelihood, precision, convergence and scores||167-190||Vid 1 (30:39), Vid 2 (20:12)||pynb d3p1_ll, d3p2_grad|
|Solving: Solving non-linear equations||191-198||Vid (15:06)|
|StDev: standard deviation||199-205||Vid (17:34)||pynb d3p3_sd|
|Restrictions: SLSQP vs BFGS||206-232||Vid (27:17)|
|Extra: Speed||233-234||Vid (29:46)|
|Closing thoughts||See class, with estbern.py|