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
Introduction to Python and IPhython. Data types and structures: the numpy library. (3h)
I/O operations. Working with dates/time. Financial panel data: the pandas library. (3h)
High-frequency data in Python. Data visualization: the matplotlib library. (3h)
Interpolation and curve fitting. Symbolic mathematics in Python. Principal component analysis. (3h)
Optimization (with constraints). Portfolio selection in Python and the efficient frontier. (3h)
The scipy library. Regression analysis. Hypothesis testing. (3h)
Generating random numbers. Monte Carlo simulations. Simulating stock price paths (Brownian motion with jumps). Value-at-Risk and Expected Shortfall. (3h)
Option pricing with binomial trees and Monte Carlo simulation. Least-Squares Monte Carlo for pricingAmerican options. (3h)
Hilpisch, Yves, Python for Finance: Analyze Big Financial Data, 2015, O’Reilly Publishing
Python 2.7.9 documentation at: https://docs.python.org/2/
Final exam (75%) and one individual programming assignment (25%).
Recommended prior knowledge
Notions of portfolio theory, regression analysis, and derivatives pricing.