COMP0043-matlab代写
时间:2022-12-05
Department of Computer Science, University College London
COMP0043 Numerical Methods for Finance
Dr Guido Germano
Alternative assessment 2019–2020
Choose one of the following questions and write a program to answer it. You may use
Matlab, C++ or Python. Please ask for permission if you prefer another programming
language.
To reduce grade inflation, the programming style will be weighted more than in the
in-class assessments, so do not just hack something that runs and produces the correct
result, but try also to organise and comment your code as well as format its output in
order to make it easily understandable by a human.
Questions
1. Heston stochastic volatility model
In the Heston stochastic volatility model (1993) the variance evolves with a Feller square-
root process (1951), used also in the Cox-Ingersoll-Ross model for the term structure
of interest rates (1985). The Heston model is more realistic than the older stochastic
volatility model of Stein and Stein (1991), where the variance evolves with an Ornstein-
Uhlenbeck process (1930), because the latter mean-reverting process is Gaussian and thus
its support is R, while the Feller square-root process bounds the variance to R+. For the
system of stochastic di↵erential equations describing the Heston model, see Eq. (1) in
Yiran Cui, Sebastian del Ban˜o Rollin, Guido Germano, “Full and fast calibration of
the Heston stochastic volatility model”, European Journal of Operational Research 263
(2), 625–638, 2017, DOI 10.1016/j.ejor.2017.05.018, available on the Moodle page of
COMP0043, Section 8.
a) Write a script for the Monte Carlo simulation of the Heston stochastic volatility model
combining the script gbp.m that simulates geometric Brownian motion and the script
fsrp.m (formerly cirp.m) that simulates the Feller square root process. The generation
of correlated normal random numbers is described in Course Notes on Computational
Finance, Chapter 2.4, in Tools from Stochastic Analysis for Mathematical Finance: A
Gentle Introduction, Chapter 10.9.7, and in Numerical Recipes in C++: The Art of
Scientific Computing, 3rd edition, Chapter 7.4.
b) Add code to price call and put European options as in the Monte Carlo section of our
Black-Scholes pricing script bs.m. Use the parameters in Table 1 of Cui et al. (2017).
c) Check the price by integrating the characteristic function as in the Fourier transform
section of bsx.m; see Section 3.2 of Cui et al. (2017) for the pricing equation, Eq. (9),
and the characteristic function ; for the latter, use both the expressions of Schoutens
et al. (2004), Eq. (12), and Cui et al. (2017), Eq. (14): they should give the same
result.
UCL COMP0043 AA 2019–2020 1 TURN OVER
essay、essay代写