MA417 Computational Methods in Finance

Assessed Coursework Summer 2021


2020/21 syllabus only — not for resit/deferred candidates


1 Guidelines

1.1 Submission

Your coursework must be submitted by

Wednesday 5th May 2021, 4pm (UK time).

• All consequences regarding late submission can be found on the School’s website

https://info.lse.ac.uk/Staff/Divisions/Academic-Registrars-Division/Teaching-Quality-Assurance-and-Review-Office/Assets/Documents/Calendar/GeneralAcademicRegulations.pdf

Note in particular: Five marks (out of 100) will be deducted for coursework submitted within 24 hours of the deadline and a further five marks will be deducted for each subsequent 24-hour period until the coursework is submitted.

After five working days, coursework will only be accepted with the permission of the Chair of the Sub-Board of Examiners.

• Please submit all your files by email to [email protected]. Include “MA417 submission” in the subject line.

• Please submit the following files:

– One zip-file that has the following name: If your candidate number is 123456, then name your zip-file MA417 CN123456.zip.

This zip-file should contain the following files:

∗ One Jupyter Notebook, i.e., an .ipynb file, that the examiners can run, that contains a report answering all questions and the Python code used to derive the answers.

Use your coursecode and candidate number as file name, e.g., MA417 CN123456report.ipynb.

∗ Your Jupyter Notebook saved as a pdf-file.

Use your coursecode and candidate number as file name, e.g., MA417 CN123456report.pdf.

– The Plagiarism Statement (not within the zip-file!).

Use your coursecode and candidate number as file name, e.g., MA417 CN123456 Statement.pdf.

• The content of your work must remain anonymous, so do not write your name on anything ex-cept the Plagiarism Statement. Instead, you must identify your work with your Examination Candidate Number. You can check your candidate number on ’LSE for You’.


1.2 Academic integrity

• When you submit the coursework you must submit a completed and signed copy of the Plagiarism Statement (available on Moodle).

You are required to read the information on plagiarism on the following website:

https://info.lse.ac.uk/Staff/Divisions/Academic-Registrars-Division/Teaching-Quality-Assurance-and-Review-Office/Assets/Documents/Calendar/RegulationsAssessmentOffences-Plagiarism.pdf

Note in particular the first paragraph on this website: “All work for classes and seminars (which could include, for example, written assignments, group work, presentations, and any other work, including computer programs) must be the student’s own work. Direct quotations from other work must be placed properly within quotation marks or indented and must be cited fully. All paraphrased material must be clearly acknowledged. Infringing this requirement, whether deliberately or not, or passing off the work of others as the students own work, whether deliberately or not, is plagiarism.”

• Note that all reports and codes will be submitted to Turnitin for textual similarity review and the detection of plagiarism.

• You must take this assessment completely alone and not show or discuss it with anyone else.

• This is an open book assessment and you are allowed to use any material made available on Moodle for MA417, ST433, and any academic literature as long as you cite the material that you use fully.

There are restrictions, however, on which software libraries you are allowed to use for the programming part, please see below.

• You are not permitted to: consult any other person about the content of the assessment; allow any other person to edit or proof read your work; submit any ideas or phrasing that are not your own (without appropriate citation).

• You should not include any writing of your own that has been submitted for a different summative assessment.

• The examiners may conduct vivas to check that you were the author of your submitted assessment.


1.3 Specific guidelines on report

• The coursework consists of four problems. Your answers to all four problems will count towards the final mark.

• Write a report (in the form of a Jupyter notebook) and not just a question-answer style exercise set solution to answer the questions. Your report should contain all results and their derivation (mathematical arguments and Python code), interpretation and discussion. Use complete sentences throughout. Give detailed arguments to explain your ideas and carefully justify your answers.

• The only acceptable programming language is Python 3.8. The only Python libraries that you are allowed to use are:

– numpy

– scipy.stats

– matplotlib.pyplot

You have to write your own Python code and you must not use code from any other sources (libraries, books, internet etc.) - the only exception to this rule is that you are allowed to use Python code that is available on the MA417 Moodle page.

• Please only provide one Jupyter notebook. Separate answers to the different questions clearly in this notebook.

• Your submitted Jupyter notebook should run completely without any error messages.

• In particular, note that your Jupyter notebook should NOT ask the user to enter variables needed for the computation. Choose reasonable default parameters yourself and make clear in your instructions what the meaning and the names of the variables are such that the examiners can test several examples.

• Add appropriate comments to your code to explain what your code is doing.

• Your figures should be well formatted, with good axis labelling and appropriate titles.

• Page limit: Use concise writing throughout. The pdf-version of your Jupyter notebook must not exceed 35 A4 pages (using the standard settings within the Jupyter notebook).


1.4 Assessment

The coursework will be marked in line with the departmental assessment criteria which are available on p.19-20 here:

https://www.lse.ac.uk/Mathematics/assets/documents/Handbooks/2020-21/MSc-Financial-Mathematics-Student-Handbook-large.pdf


1.5 Estimated approximate effort required

The estimated approximate effort required for this coursework is 24 hours.


1.6 Questions about the coursework

If you find that you have a question which is one where you would normally put your hand up (during a sit-down exam) and ask the invigilator for clarification, this is what to do and how we will manage it:

1. First check the Announcements forum on the Moodle page for the course to see if someone has asked the same question and it has been answered already. Posting to the Moodle forum by students is disabled during the coursework period.

2. If your query is new, email your question to

[email protected]

using the course code as subject line. Do NOT email the convenor directly. We have set up this invigilator email address so that all queries go to multiple recipients directly (programme managers, etc.). This is to ensure the messages are not missed and are followed up promptly.

3. Your name will be removed from your email and your question passed on to the person who set the coursework.

4. Your question will be considered by the person who set the coursework as soon as possible. Any clarification that will be given in response to a question that is potentially relevant to everyone, will be communicated via the Moodle Announcement forum for the course so that everyone can read it.

Responses to questions asking about potential mistakes/typos in the coursework, will only be announced to everyone if there was indeed a mistake/typo in the coursework. If there is no mistake/typo, the programme manager will pass on the reply only to the person who asked the question.

5. The mailbox for [email protected] will be monitored at regular intervals during the week, but will not be monitored at weekends or bank holidays.


2 Description of coursework

If you use a random number generator for any of the problems below, seed the generator so that the results are reproducible.

Problem 1. Explain and discuss the relevance of the Normal distribution in the context of Monte Carlo estimation.

Problem 2. Consider the function f : R → R given by



for some fixed λ > 0.

1. Prove that f is a probability density function (pdf ).

2. Explain how you can generate a sample from f using the inverse transform method. Implement the inverse transform method for generating a sample from f in Python and show a histogram of a sample generated from f.

3. Suppose you would like to generate a sample from f using von Neumann’s acceptance-rejection algorithm.

(a) Specify two different probability density functions g1 g2 with g1 f and g2 f that can be used for this purpose. Discuss which of the two pdfs g1 and g2 you prefer to use in von Neumann’s acceptance rejection algorithm for generating a sample from f and give reasons for your choice.

(b) Write down von Neumann’s acceptance-rejection algorithm that is designed such that it has the highest possible acceptance rate for your preferred choice of gi. Explain how you can generate the required sample from your preferred gi.

(c) Implement von Neumann’s acceptance-rejection method for generating a sample from f by using your preferred choice of gi in Python and show a histogram of a sample generated from f.

4. What is your preferred method for generating a sample from f and why?

Problem 3. Consider the standard Black-Scholes financial market consisting of two assets: The riskless asset has time-t price , where r ≥ 0 is the constant interest rate and the stock has time-t price

where S0 > 0 is the initial stock price, σ > 0 is the volatility, (Wt)t≥0 is a standard one-dimensional Brownian motion under the risk-neutral measure.

Consider an option whose payoff at maturity T > 0 is given by H(ST ), where

1. Write down a Monte Carlo estimator together with an asymptotic 95% confidence interval for the time-0 price of an option with payoff H(ST ) given in (2) and justify your answer. Implement the Monte Carlo estimator and an asymptotic 95% confidence interval for the time-0 price of the option with payoff (2) in Python.

2. Specify two alternative estimators for the time-0 price of an option with payoff H(ST ) that have lower variances than the Monte Carlo estimator considered in part 1. Implement both in Python and discuss and compare their performance.

3. Consider the following function



where H(ST ) is given in (2).

(a) Explain how you can numerically approximate the derivative of the function k with re-spect to S0, denoted by , assuming that you cannot evaluate this deriv-ative analytically in the following situations:

i. k(S0) is known analytically;

ii. k(S0) is not known analytically.

Justify your answers.

(b) Write Python code that numerically approximates the derivative kS0 for the situation (a)(ii) and plot the approximation of the derivative kS0 as a function of S0. Discuss your results. In particular, comment on what the financial interpretation of the derivative kS0 is.

Problem 4. Consider a continuous-time stochastic process (log(St))t≥0 whose sample paths are simulated on a discrete-time grid given by the points ti = ih, i ∈ {0, . . . , N} where h > 0 and N ∈ N using the following recursive scheme:

 for some fixed A0, S0 > 0.

Then, for n = 0, . . . , N − 1 set

where the 2-dimensional random vectors  are i.i.d., and for each n ∈ {0, N − 1} the 2-dimensional random vector  has a multivariate Normal distribution with mean   and covariance matrix , where ρ ∈ (1, 1).

Furthermore, , log denotes the natural logarithm and .

1. Write down a stochastic differential equation for the stochastic process (log(St)) and a stochastic differential equation for a stochastic process (At)t≥0 that can be approximated by the scheme in (3). Justify your answer.

2. Write Python code that implements the simulation scheme given in (3) and use it to plot several realisations of the sample paths of the corresponding stochastic process .

3. Suppose the scheme in (3) is used to approximate a sample path of (log(St)), where (St) represents the price of a risky asset (e.g., a stock price). Consider the same option payoff H(ST ) as in Problem 3 (2). Write Python code to approximate the time-0 price of this option using a Monte Carlo estimator together with the simulation scheme in (3).

Compare your results to the results obtained in the standard Black-Scholes model and discuss your findings.