Introduction to Programming and Numerical Analysis
"This course has been amazing. It feels like i'm weaponizing the text-book theory from other courses." (student evaluation)
Course responsible:
Jeppe Druedahl, Associate Professor, University of Copenhagen, Department of Economics, Center for Economic Behavior and Inequality
Asker Nygaard Christensen, PhD student, University of Copenhagen, Department of Economics
Course description
This course introduces you to programming and enables you to numerically solve simple economic models and perform basic data analysis. This will e.g. allow you to both visualize solutions, easily test assumptions with respect to functional forms and parameters, and consider more realistic models, which are solvable numerically but not algebraically.
We will mostly use the Python programming language, and focus on well-known microeconomic and macroeconomic models from the core bachelor courses (Edgeworth, Koopman, Solow, AS-AD etc.). The course requires you to get your hands dirty - programming is not a spectator sport!
Once you are done with the course, you will have learned all of the tools necessary for programming a numerical solution algorithm for any economic model you face in your undergraduate and graduate courses.
The course is divided into four parts:
Fundamentals: Print, plot, optimize, simulate, structure, document, work-flow.
Working with data: Fetch, combine, split-apply-combine, visualize.
Algorithms: Pseudocode, algorithms, complexity, solve, optimization, symbolic.
Further perspectives: Structural estimation, vectorization, parallelization, timing, numba.
Getting started
Datacamp: All students attending the course will receive 6 months of free access to DataCamp. You will receive an e-mail regarding this.Â
In the first classes, you will follow online courses at DataCamp to learn the basics of Python.
Installation: Follow the installation guide.
The course material is availible here:
Lectures: https://github.com/NumEconCopenhagen/IntroProg-lectures
Exercises: https://github.com/NumEconCopenhagen/IntroProg-exercises
Deadlines for hand-in etc.: See calendar
More practical information: kurser.ku.dk
Learning Outcome
Knowledge:
Describe the differences between data types (e.g. strings, booleans, integers and floats)
Describe the differences between data containers (e.g. lists, dicts and arrays)
Explain the use of conditionals (if-elseif-else)
Explain the use of loops (for, while, continue, break)
Explain the use of functions, methods and classes
Describe the difference between views and copies of objects
Explain how to use (pseudo) random numbers
Explain the notation of numerical algorithms
Skills:
Setup a Python environment
Write Python scripts, functions and notebooks
Apply error handling and debugging techniques
Use and write code documentation
Print results and make static and interactive plots
Import and export of data from and to csv, excel and online databases
Perform simple descriptive analysis of numerical data
Use numerical equation solvers
Use symbolic equation solvers
Use numerical optimizers
Formulate numerical algorithms from mathematical problems
Competencies:
Work collaboratively on code projects
Use online communities to find existing code and get help
Solve mathematical problems numerically
Solve well-known economic problems numerically
Perform numerical simulation of stochastic models
Present and discuss results of a numerical analysis
Learn new programming tools and languages