关键词 > MATH4090/7049

MATH4090/7049: Computation in financial mathematics Practical 1

发布时间:2022-08-16

Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

MATH4090/7049: Computation in financial mathematics

Practical 1

Semester II

Notation: “Lx.y”refers to [Lecture x, Slide y]

1. Download Matlab files myblsprice .m and test myblsprice .m from Blackboard into the same direc- tory.

For the first task, you are asked to complete the function myblsprice .m (see details below), which will be called by the code in test myblsprice .m, such that test myblsprice .m runs properly, as it is currently written, and output “myblsprice.m passed”.

Do not make any changes to test myblsprice .m

Details: function myblsprice .m computes the Black-Scholes call option price.  It takes, as input argu-

ments, the stock price S, the strike K, the risk-free rate r, the time to maturity τ = T t, and the volatility

CBS  = SN(d1 ) Kerτ N(d2 ),

where N(x) = ^ ley2 /2dy, the CDF of the standard normal, and

d1 = ,    d2 = d1 σ ^τ .

In Matlab, N(x) can be computed using the built-in function normcdf(x).

timet0                   timet1                   timet2                   timet3

S3t3

S2t2

S1t3

S0t0

S- 1t3

S-2t2

S-3t3

Figure 1: An example of a 3 period binomial tree. The subscript is the time index. For simplicity St(j)n   = Sn(j) .

2. Read again L1 notes (in Learning Resources). For your convenience, a description of a N-period no-arbitrage binomial tree is given below.

At node (n,j) of the binomial tree, the asset price at that node, denoted by Sn(j), can move up to S with probability pu or move down to Sn(j)1(1) with probability pd = (1 − pu). More specifically,

Sn(j) S = uSn(j) Sn(j) Sn(j)1(1) = dSn(j)

with with

probability pu ,                  probability pd = (1 pu),

where u and d are the up and down multipliers, respectively. In this question, we assume that

u = eσ ^t,    d = ,    a = ert,    pu =u(a) d(d) ,

where r is the positive constant risk-free interest rate, σ is the positive constant volatility of the underlying asset, and ∆t = , with T being the maturity of the option. We also assume that ∆t is sufficiently small so that 0 < pu < 1. An example of such a tree with n = 3 is given in Figure 1.

Download Matlab files tree slow .m, test tree slow .m, and exact payoff .dat from Black- board into the same directory.

For this task, you are asked to complete the function tree slow .m, which will be called by the code in test tree slow .m, such that test tree slow .m runs properly and output“tree slow.m passed”.

Do not make any changes to either test tree slow .m or exact payoff .dat.

3. For this task, you are asked to price a European option using the same no-arbitrage binomial tree method described in L1 (in Learning Resources).

Complete the function tree slow european .m, which will be called by the code in

test tree slow european .m, such that test tree slow european .m runs properly and outputs “tree slow european.m passed”.

You should see that in tree slow european .m the parameters of the tree and payoff vector at time T, discussed in the previous question, are given.

Do not make any changes to test tree slow european .m

4. Consider two vanilla T-maturity European financial derivatives, namely X and Y, written on the same un- derlying asset, whose payoff functions are fX (ST) and fY (ST). Here, ST denotes the price of the underlying asset at maturity. Suppose that fX (ST) ≤ fY (ST), for all ST .

To price these financial derivatives, we use the (no-arbitrage) binomial tree method for European options discussed in L1. Let the number of time periods of the tree, denoted by N, be fixed. We respectively denote

by Xn(j) and Yn(j) , −n n, 0 N, the numerical solutions at node (n,j) obtained by the pricing

Mathematically prove or disprove the following statement:

Xn(j)  Yn(j) ,    n,    0 N.


Optional

5. Vectorize the code you developed for the previous question, i.e. vectorize tree slow european .m.

Download the files tree fast european .m, test tree fast european .m from Blackboard into the same directory.

Then complete the function tree fast european .m, which will be called by the code in

test tree fast european .m, such that test tree fast european .m runs properly and outputs “tree fast european.m passed”

Do not make any changes to test tree fast european .m