Python programming for finance
Les objectifs du cours
The aim of this class is to provide students with the tools for financial data analysis in Python. The first part of the course (four lectures) introduces the basic tools for working in Python: how to get data, clean it, and obtain summary statistics. The second part of the course focuses on financial applications: portfolio optimization, regression analysis, Value at Risk, and derivatives pricing. Students are introduced to the four “scientific libraries” in Python: numpy, scipy, pandas, and matplotlib.
Plan du cours
Basics of Python: data types, loops, functions, list comprehensions and a glimpse of objet oriented programming (3h)
Advanced Python: functional programming, generators... and an introduction to the numpy library. (3h)
Data Analysis with pandas: I/O operations. Working with dates/time. Financial panel data: the pandas library. (3h)
High-frequency Data and Visualisation: Data visualization the matplotlib library. (3h)
Regression. Optimization: Interpolation and curve fitting. Symbolic mathematics in Python. Principal component analysis. (3h)
Stochastic Processes in Python: Generating random numbers. Monte Carlo simulations. Simulating stock price paths (Brownian motion with jumps). Value-at-Risk and Expected Shortfall. (3h)
Option Pricing: Option pricing with binomial trees and Monte Carlo simulation. Least-Squares Monte Carlo for pricing American options. (3h)
Portfolio Theory. Efficient frontier. PCA Analysis. Test for normality. (3h)
Hilpisch, Yves, Python for Finance: Analyze Big Financial Data, 2015, O’Reilly Publishing
Python 3.7 and other pydata libraries from Anaconda: https://www.anaconda.com/distribution/
Final exam (75%) and one individual programming assignment (25%).
Recommended prior knowledge
Notions of portfolio theory, regression analysis, and derivatives pricing.