# 金融编程代写｜MATH60082 (Computational Finance) Finite Difference Methods Assignment

1 Background Theory
1.1 Coupon Bonds with Stochastic Interest Rate

Consider a set of coupon bonds B are trading on the financial markets, and the term structure of interest rates is stochastic. Let us denote B(r,t;T) as the value of a bond at time t that matures at time T, given the current stochatic interest rate is r. Later on in this project, you will be asked to price the option to buy (or sell) a coupon bond at some time T1 before the bond matures T1 < T. To price this contract, we need to first calculate the value of the bond B(r,t;T) at all time t < T.

The risk-neutral process followed by interest rate is given by

Here κ, θ, μ, σ and β are all constant model parameters that can be determined from market prices of zero coupon bonds.

It is relatively straightforward to show that the market value of the coupon bond B(r,t;T) satisfies the following PDE

if the bond pays out a continuous coupon at the rate of

for constants C and α defined in the bond contract.

(3)

The domain of this problem is r ∈ [0, ∞) and t < T . The boundary conditions are:

1.2 Options on a Bond

Now consider an option V to buy the bond at time T1. Let V(r,t;T1,T) be the value of a call (or put) option to buy (or sell) at time T1 the coupon bond B(r, t; T ) maturing at time T . On the domain r ∈ [0, ∞), t < T1, it can be shown that function V satisfies the following PDE:

American Call Option

For an American call option, at expiry time t = T1 we have:
V (r, t = T1; T1, T ) = max(B(r, T1; T ) − X, 0). (8)

If the option to buy the bond is exercised early,
V (r, t; T1, T ) = B(r, t; T ) − X

so according to no arbitrage and early exercise, the option must satisfy
V (r, t; T1, T ) ≥ max(B(r, t; T ) − X, 0) for t ≤ T1; (9)

Finally the boundary conditions are:
V (r, t; T1, T ) = B(r, t; T ) − X

at r = 0; (10) r → ∞. (11)

and

American Put Option

V (r, t; T1 , T ) → 0 as

For an American put option, at expiry time t = T1 we have:
V (r, t = T1; T1, T ) = max(X − B(r, T1; T ), 0). (12)

If the option to buy the bond is exercised early,
V (r, t; T1, T ) = X − B(r, t; T )

so according to no arbitrage and early exercise, the option must satisfy
V (r, t; T1, T ) ≥ max(X − B(r, t; T ), 0) for t ≤ T1. (13)

Finally the boundary conditions are:

and

∂V +κθeμt∂V =0, ∂t ∂r

V (r, t; T1, T ) → X − B(r, t; T )

atr=0; (14)

as r → ∞. (15)

2.1 Bonds

Write out the correct numerical scheme (i.e. aj =, bj =, cj = and dj =) matching the PDE for a bond (2), including the boundary conditions (5) and (6) at j = 0 and j = jMax. Be careful to make your notation clear and understandable.

(understanding 5 marks)

Unless otherwise instructed, you should assume that the following standard values for the parameters apply: T = 3, F = 110, θ = 0.0546, r0 = 0.0515, κ = 0.07884, μ = 0.0065, C = 6.28, α = 0.03, β = 0.532 and σ = 0.235.

• Write code to calculate the value of the bond B(r,0;T) using rmax = 1, iMax = 100 and jMax = 100. You must use the finite-difference method with a Crank-Nicolson scheme, along with an appropriate method to solve the algebraic system. State the value of the bond B(r0, 0; T ) using these parameters.

• An alternative boundary condition is
∂r

∂B → 0 as r → ∞.
Plot out the value of the option B(r, 0; T ) against the interest rate r for r ∈ [0, rmax] and compare the

results with different boundary conditions.
Comment on the results in each case, can you explain which boundary condition works best and why?

(understanding 5 marks)

• Include in your report an accurate estimate for the bond price B(r0,t = 0;T) using the parameters outlined above. Explain how you obtained your result, how efficient it is, and also how accurate it is, by exploring the effect that each of the different numerical parameters (iMax, jMax, rmax) have on your solution.

2.2 Options on Bonds

You are tasked to solve for an American put option.

Unless otherwise instructed, you should assume that the following standard values for the parameters apply: T = 3, T1 = 1.2211, X = 110, F = 110, θ = 0.0546, r0 = 0.0515, κ = 0.07884, μ = 0.0065, C = 6.28, α = 0.03, β = 0.532 and σ = 0.235.

• Write out the correct numerical scheme (i.e. aj =, bj =, cj = and dj =) matching the PDE for the European put option (7), how you solved for early exercise, and also appropriate boundary conditions such as (14), (15) at j = 0 and j = jMax. Describe how you setup your grid to match the problem.

(understanding 5 marks )

• WritecodetocalculatethevalueofboththeoptionV(r,t;T1,T)(fort≤T1)andthebondB(r,t;T) (for t ≤ T). Plot out the value of the American option V against the interest rate r at time t = T1 and time t = 0. What is the minimum value of r at time t = T1 at which the option is exercised?

(coding 2 marks, understanding 5 marks)

• State an accurate value for the American option V (r0, 0; T1, T ) using the parameters as given above. Explain how you obtained your result, how efficient it is, and also how accurate it is, by exploring for example the effect that each of the different numerical parameters (iMax, jMax, rmax) and different boundary conditions have on your solution.

(understanding 2 marks, originality 10 marks)