Question: 3. (Numerical Differentiation) In Chapter 8 we discussed numerical differentiation of a function based on divided differences. We saw that this was an ill-posed problem
3. (Numerical Differentiation)
In Chapter 8 we discussed numerical differentiation of a function based on divided differences. We saw that this was an ill-posed problem using floating-point arithmetic. In particular, smaller mesh sizes can lead to catastrophic cancellation (when two almost equal numbers are subtracted from each other) due to the finite precision of floating-point numbers.
One possible solution is to use multiple precision data types.
In this exercise we investigate numerical differentiation of a function f by approximating it by a cubic spline and using formulae (13.38) and (13.37) as the surrogates for the first and second derivatives of the function,
f, respectively.
Answer the following questions:
a) Compare the accuracy and applicability of this approach compared with the ill-posed divided differences that we use to approximate derivatives in Chapter 8.
b) Consider computing the price, delta and gamma of plain call and put options (analytical solutions are known; see Haug, 2007, for example). There are six options in total.
Choose one set of three (for example, a call option price with its delta and gamma).
Approximate the option price on a given interval, for example (0, 100).
c) Compare the exact solution for the option price with the value delivered by the cubic spline.
d) Compare the exact solution for the option delta and gamma with the values delivered by the cubic spline. For completeness, compute the delta and gamma using divided differences.
e) We focus on computing delta. Compare the relative run-time efficiency when computing delta using the exact form versus formula (13.38) as implemented in the class Cubic-
SplineInterpolator.
In all cases, try to apply the utilities from Section 13.6.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
