MA323 Computational Methods in Financial Mathematics
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
MA323 Computational Methods in Financial Mathematics
Assessed Coursework (2022)
1 Guidelines
1.1 Submission
Your coursework must be submitted by
Monday 25th April 2022, 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 your complete report together with all files to j.l.everid@lse.ac.uk. Include “MA323 submission” in the subject line.
● For the submission please only submit one zip-file that contains all your files except the Plagiarism Statement, which you should submit in the same email . Your zip- file should have the following name: If your candidate number is 123456, then name your zip-file MA323 CN123456.zip.
Your zip-file must contain your Jupyter Notebook (please provide an ipynb file, which the examiners can run, and a pdf version of it.) You should name these files according to your course code and candidate number, e.g., MA323 CN123456report.ipynb.
● 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 student’s own work, whether deliberately or not, is 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 MA323 and any academic literature as long as you cite the material that you use fully.
● 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 and not just a question-answer style exercise set solution to answer the ques- tions. Your report should contain all results and their derivation, interpretation and discus- sion. Use complete sentences throughout. Give detailed arguments to explain your ideas and carefully justify your answers.
● The only acceptable programming languages are Python 3.7, 3.8, 3.9, or 3.10.
● Please only provide one 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.
1.4 Assessment
The coursework will be marked in line with the departmental assessment criteria which are available on pages 17/18 of your student handbook:
https://www.lse.ac.uk/Mathematics/assets/documents/Handbooks/2021-22/ Undergraduate-Handbook-2021-22.pdf
2 Coursework Description
If you use a random number generator for any of the problems below, seed the generator so that the results are reproducible.
Problem 1. Consider the two integrals
K1 =
K2 =
4 1
0 (2 + cos(α))2
o
α3/2e-x2 /2dασ
0
(a) Describe a numerical method to approximate the value of K1 such that the approximation error
is guaranteed to be bounded by 1/100. Implement this method in Python and provide the value of the approximation.
(b) Explain how one can approximate the integral K2 using a Monte Carlo estimator. Implement
the Monte Carlo estimator in Python and provide a figure that plots a Monte Carlo estimate against the number of samples (as we have done in the lectures and programming sessions). Describe a variance reduction technique that can be applied here and discuss how well this technique works in this example.
Problem 2. Consider the function f : R → R given by
f (α) = ,
where 尸 is a constant.
(a) Determine 尸 such that f is a probability density function.
(b) Let 尸 be the constant such that f is a probability density function (i.e., the one computed
in part (a)). Suppose you would like to generate a sample from f using von Neumann’s acceptance-rejection algorithm. Specify a probability density function g f that can be used for this purpose and describe in detail how you can obtain a sample from f by sampling from g using von Neumann’s acceptance-rejection algorithm. For your choice of g what is the best possible proportion of numbers that your algorithm accepts? Implement von Neumann’s acceptance-rejection algorithm in Python to obtain 10000 samples from f and plot a histogram of the samples.
(c) An alternative to von Neumann’s acceptance-rejection algorithm from part (b) for sampling from f would be to use the inverse transform method. Implement it in Python and draw again a histogram of the samples. Which of these two methods do you think is more suitable for generating a sample from f and why?
Problem 3. We consider the standard Black-Scholes financial market consisting of two assets. The riskless asset has time-t price 复t = ert , where r ≥ 0 is the constant interest rate and the stock has time-t price
(1) ;t = ;0 exp ╱╱r − 、t + αwt、.
where ;0 事 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.
Fix a constant s 事 0 and consider a European option with payoff z at the maturity date T 事 0 given by
(2) z = |;T − s| σ
(a) Derive an analytical formula for the time-0 price of this option.
(b)(b.1) Write down a Monte Carlo estimator for the time-0 price of this option. Justify your
answer.
(b.2) Explain in detail how one can generate the random variables that are used in your Monte
Carlo estimator in part (b.1).
(b.3) Compute the variance of the Monte Carlo estimator for the time-0 price of the option
analytically.
(b.4) Write down a 95% and a 99% asymptotic confidence interval for the time-0 price of the
option using your Monte Carlo estimator.
(c) Write Python code
(c.1) that computes the time-0 price of the option using the analytical formula and
(c.2) that computes the approximation of the time-0 price of the option using a Monte Carlo
estimator together with an asymptotic confidence interval.
(d) Use your Python code to compute the time-0 price of the option for the model parameters ;0 = 4, s = 5, r = 0 σ 01, α = 0 σ 2, T = 1 using both the analytical formula and the Monte Carlo estimator. Provide a 95%-asymptotic confidence interval for the time-0 price of the option. Discuss your results.
(e) Describe a variance reduction method to approximate the time-0 price of the option and im-
plement it in Python. Compare the results based on the variance reduction method of your choice to the standard Monte Carlo estimator and to the analytical solution. Discuss your findings.
Problem 4. This question continues the previous one, but now we leave the world of the Black- Scholes model. We still assume that the time-t price of the riskless asset is given by 复t = ert with r ≥ 0. However, we now assume that the dynamics under the risk-neutral measure of the risky asset are given by
(3) d;t = r;tdt + α(1 + ;t)dwt.
where (wt)t>0 is again a Brownian motion under the risk-neutral measure and α 事 0. In case the stock price hits zero we assume that it stays at zero. As before we assume ;0 事 0 .
(a) Explain how you can generate a sample path of ; = (;t)t>0 given in (3) on the discrete time
grid 0 < h < 2h < σ σ σ < nh for h 事 0, n ∈ N. Write Python code that provides samples of ;T . Create a plot with ten sample paths of (;t) for ;0 = 4, r = 0 σ 01, α = 0 σ 2, and T = 1 with h = 1/250 .
Additional detail: It might happen that your approximation of ;ih for some i ∈ {1.2.σ σ σ.2} becomes negative. Whenever this happens you should replace your approximation by zero.
(b) Fix a constant s 事 0 and consider a European option with payoff z at the maturity date
(4) z = |;T − s| σ
Write down a Monte Carlo estimator for the price of this option if the stock price is given by the dynamics in (3) . Justify your answer.
(c) Write Python code that computes the approximation of the time-0 price of the option using a Monte Carlo estimator together with an asymptotic confidence interval. Use your Python code to compute the time-0 price of the option for the model parameters ;0 = 4, s = 5, r = 0 σ 01, α = 0 σ 2, T = 1 using the Monte Carlo estimator. Provide a 95%-asymptotic confidence interval for the time-0 price of the option. Discuss your results.
(d) Specify two control variate estimators, that differ in the choice of the random variable used as control, for approximating the time-0 price of the option with payoff (4) under the dynamics of (3) and implement them in Python. Compare the results based on these two control variate estimators and the standard Monte Carlo estimator. Discuss your findings.
2022-04-23