Summary
The lectures provide an introduction to MATLAB programming with a focus on finance. The first set of lectures are devoted to the introduction of standard programming of loops and function. A second set of lectures is devoted to the computation of financial returns on assets, and optimization methods applied to portfolio theory. At the end of the lectures, students are expected to master the basics of programming, and apply portfolio theory to real time financial data.


Installing MATLAB: Dauphine provides a free licence for students. Please use your own laptop if you can with MATLAB installed. Please have Datafeed, Optimization and Econometrics toolboxes installed.

Real time macro-data on MATLAB


This is a must-read as all of the lectures will rely on DBnomics. The latter is a database aggregator which can be queried directly from MATLAB. Please read carefully this following note on DBnomics and download as well the MATLAB function which allows to get real time macro data:

DBnomics.pdf a small guide to use DBnomics on MATLAB. call_dbnomics.m MATLAB function to query DBnomics.

Get yahoo data

getMarketDataViaYahoo.m A MATLAB function to get financial data from yahoo. test_yahoo.m A working example for downloading historical financial data.

Handouts list

Lecture 1: Introduction to MATLAB Programming
Objectives of the Lecture:

  • Utilize the basic mathematical operations;
  • Get know the general purpose commands of Matlab;
  • Manipulate matrix calculus;

Materials:

chapter1.pdf Handout
Lecture 2: Plotting
Objectives of the Lecture:

  • UPlotting 2D and 3D graphs;
  • Define the curve shape, titles and legends.

Materials:

chapter2.pdf Handout
Lecture 3: Loops and Conditional Statements
Objectives of the Lecture:

  • Mastering the use of conditional statements;
  • Coding loops with both while and for.
Materials:

chapter3.pdf Handout
Lecture 4: Functions
Objectives of the Lecture:

  • Write a function with n-input arguments;
  • Code a function n-output variables;
Materials:

chapter4.pdf Handout
Lecture 5: Bonds and Interest Rates Valuation
Objectives of the Lecture:

  • Compute the price of a zero coupon bonds;
  • Calculate its interest rate;
  • Use loops and functions;
Materials:

chapter5.pdf Handout
2D_portfolio.m Load Data for last exercise

Previous Exams

Exam 2017.