C++实验编程 写作、 辅导data编程、 辅导c/c++程序实验

” C++实验编程 写作、 辅导data编程、 辅导c/c++程序实验Computational Finance with C++CourseworkHanded out: 17/05/2021Due: 1pm 7/06/2021Exercise 1.The aim of this exercise is to construct a portfolio optimization solver and performbacktesting to assess the performance the Markowitz model.You are given a file containing Returns from 83 of the FTSE 100 companies. The datais 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 andcsv.cpp contains a function that read files in the csv format. An example of how touse this function is given in read_data.cpp.For the given dataset, compute the solutions using a rolling in-sample window of 100returns observations. Set the in-sample window on the first 100 time periods, thenselect 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 12out-of-sample periods and the exclusion of the first 12 periods of the previous insamplewindow. Then rebalance the portfolio by solving the model again, and repeatuntil the end of the dataset (see Figure below).The three parts are parameter estimation, portfolio selection, and backtesting. Thesethree 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 willbe used to perform Parameter estimation. You will need to provide functions1timetime100 days 12 days100 days 12 days 12 daysout ofsampleinsampleout ofsampleinsampleFigure 1: Rolling back-testing procedure.to estimate the mean and covariance matrix. The mean return for asset i canbe estimated as follows:ri =1nXnk=1ri,k .where ri,k is the return of asset i on day k, and n is the number of days used inthe in-sample window for parameter estimation (in this case 100).The (i,j)-th entry of the covariance matrix can be calculated with the help ofthe following formula:ij =1n 1Xnk=1(ri,k ri)(rj,k rj ).The estimated Covariance matrix will be denoted by and the estimate returnsby r.(B) Portfolio Optimization: It was shown in the lecture that the optimal portfolioweights (w) can be obtained by solving the following system of linear equations,Where and are the Lagrange multipliers, and rP is the target return, erepresents a vector of ones.Denote the system of linear equations as Qx = b. Then the following algorithm(called the conjugate gradient method) can be used to solve it.A typical tolerance is 10e 6.2Algorithm 1: Conjugate Gradient Method Quadratic ProgramsInput : Initial point x0, matrix Q, right hand side vector b, and solutiontolerance .0. Initialize:(C) Backtesting is the process of testing a trading strategy on relevant historical datato ensure its viability before the trader risks any actual capital. In the final partof the coursework you Will evaluate the performance of your portfolio. Constructa number of portfolios with different target returns using the in-sample dataset.Then compute the average out of sample return, and covariance of the asset. Tobe precise, let w denote the optimal portfolio, r denote the average return overthe out-of-sample period, and denote the out of sample covariance matrix.The rw, and ww are the actual average returns and covariance of theportfolio.Evaluation: Write a report describing the classes you developed to solve the problemdescribed above. Your report should contain the following sections:1. Software Structure: Describe the classes you developed and how they are linked.For this purpose you Can use simple diagrams like the ones we used in class.2. Evaluation: Describe the performance of the Markowitz model for the differenttarget returns. You should compute the returns for 20 portfolios with differentreturns (from 0.0% to 10%). Use figures and tables to illustrate your findings.33. Appendix: In the Appendix you should include your code. Please make sure itis well documented.4 https://www.daixie0.com/contents/13/6081.html

添加老师微信回复‘’官网 辅导‘’获取专业老师帮助,或点击联系老师1对1在线指导