C++金融代写 C++数学代写 Cpp金融代写 Cpp数学代写
Exercise 1.
Computational Finance with C++ Coursework
Due: 10/06/2020
The aim of this exercise is to construct a portfolio optimization solver and perform backtesting to assess the performance the Markowitz model.
You are given a file containing returns from 83 of the FTSE 100 companies. The data is contained in a file called "assets_returns.csv".
You are also given three files to help you read the data. The two files csv.h and csv.cpp contains a function that read files in the csv format. An example of how to use this function is given in read_data.cpp.
For the given dataset, compute the solutions using a rolling in-sample window of 100 returns observations. Set the in-sample window on the first 100 time periods, then select the portfolio by solving the Markowitz model for a range of target returns. Then evaluate the performance of each portfolio on the following 12 (out-of-sample) periods. Then update the in-sample window, with the inclusion of the previous 12 out-of-sample periods and the exclusion of the first 12 periods of the previous in- sample window. Then rebalance the portfolio by solving the model again, and repeat until the end of the dataset (see Figure below).
The three parts are parameter estimation, portfolio selection, and backtesting. These three steps are described in more detail below.
(A) Parameter Estimation: For the 83 companies you are given returns for 700 days. You will use the data in a rolling fashion described above. The first part will be used to perform parameter estimation. You will need to provide functions to estimate the mean and covariance matrix. The mean return for asset i can
1
in sample
100 days
out of sample
12 days
in sample
12 days
100 days
12 days
time
time
out of sample
Figure 1: Rolling back-testing procedure. be estimated as follows:
1
