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


CS 335 - Winter 2022:  Assignment 1

 

1.  (6 marks) No-arbitrage option pricing.

Suppose the current stock price is S18.  A two state tree is defined such that after 2 months, the stock price may increase to S20 with probability 0.3 and decrease to S15 with probability 0.7.  Consider a European call option, based on this stock, with strike K=S17 and expiry T=2 months. Assume the risk-free interest rate is 10%.

(a)  (3 marks) Construct a risk-free portfolio. Then use it to determine the no-arbitrage (or fair) value of the call option. Compute the present value of the option (i.e. the value at t = 0).

(b)  (3 marks) Let Varbitrage  be the no-arbitrage value of the call option computed in part (a). Suppose such an option is sold at V*  where V*   > Varbitrage .  Describe the details for a strategy that will result in a guaranteed profit of V*  . Varbitrage   (in present value;  i.e. t = 0).  Justify your strategy.  You can assume short-selling is allowed.   (Hint:  you may keep the discounting factor in terms of the exponential function without converting it to decimals. The solution will come out cleaner.)

2.  (10 marks) Convergence of a walk on a discrete lattice.

Consider a random walk on an N step lattice with t e [0, T] and the parameters:

Xn+1     → Xn+1     → p    =

∆t    =

Xn + σ }t    with probability p,

Xn . σ }∆t    with probability 1 . p,

 ╱ 1 + }∆t← ,

T

,

which converges to the solution of the SDE

dX = α dt + σ dZ,

as ∆t → 0. The exact solution to this SDE is such that the exact density of X(T) is a normal density with mean Xinit + αT and standard deviation σ }T, assuming the initial value of X is Xinit .

Verify  this  experimentally  via  numerical  simulation  of many  lattice  walks,  by  preparing  a Jupyter/Python notebook to carry out the following:

● Perform a lattice walk simulation using the parameters given in Table 1. Starting at X0  = Xinit, the value of X is then moved up with probability p or down with probability 1 . p. A uniformly distributed random number on [0, 1] is used to determine the up/down movement.

● At the next node in the next time step, the above process is repeated until it arrives at the final position XN  after N steps at t = T.  This completes one path and creates one simulation outcome.

● Perform M simulations (i.e.  M random paths) to produce M different outcomes, {X)(, m =  1, 2, . . . , M .  Note that each step moves up or down a fixed amount, the set of all possible outcomes for this discrete lattice walk is

X)  e ←Xinit + (2j . N)σ }∆t : j = 0, 1, . . . , N… .

● As indicated in Table 1, you should perform the above process first for M = 1000 simulations, then separately for M  =  10, 000 simulations,  and finally for M  =  100, 000 simulations. In each case, print out the number of simulations (M) and the corresponding mean and standard deviation of the computed values {X)  : m = 1, . . . , M ( from the simulation in that set. Also, print out the anticipated exact mean and standard deviation for comparison.

● In addition, for each set of simulations, generate a histogram of the observed r。,、]之]t) ó{ds]t) versus X(T).   Care must be taken in scaling this histogram to get the correct  probability density.  Let p(x) be the the probability density, and let bin [a,b]  be the bin on  the interval [a, b] of the x axis. Then

b

p(x) dx      p((a + b)/2)(b . a)

a

Number of occurrences in bin [a,b]

Total number of occurrences

so that

1     Number of occurrences in bin[a,b] p((a + b)/2)   ~

Use N +1 bins, with the bin boundaries falling one-half way between the lattice nodes at time step N . Use Matplotlib’s bar function to display your probability density plot constructed as described above.  (Alternatively, if you prefer, Matplotlib’s hist or Numpy’s histogram functionality can automate some of this process, if you give it appropriately chosen values for the range, bin width, and density parameters.)

● For comparison, over top of each of your histograms, generate a standard (line) plot of the true normal distribution with mean Xinit+ αT and standard deviation σ }T, over the same range but in a different colour. The Scipy function stats.norm.pdf can be used to evaluate a true normal distribution function. Each of your three plots (for the three different values of M) should look something roughly along the lines of Figure 1.6.2 on page 14 of the course notes (albeit generated with different data).

Your code must be "{αt。r]乡{ó for efficiency; i.e. prefer vector operations instead of scalar oper- ations.  As a simple example of vectorization, if I have a NumPy vector V and I want to add 1


T

σ

α

Xinit

Number of simulations (M)

Number of time steps (N)

2.0

0.4

0.25

3

1000, 10000, 100000

100

Table 1: Data to be used in your simulation of discrete walk on a lattice.

 

to every entry of the vector, I can simply write the vector operation V  =  V+1, instead of using a slower for loop over index i and separately computing V[i]=V[i]+1 for each entry. Similarly, many NumPy functions work on vectors rather than single numbers.

Specifically, your code for the lattice walk should only explicitly loop over the time steps, not over the individual simulations – for each time step, the updates for all the simulations (within a set) should be computed together using vector operations.  Another note is that you should not store the entire lattice at once, but rather only one or two columns of it, to save on memory. The example lattice walk code in the course notes (page 16) is likely to be "{r) helpful, since it illustrates both vectorization and lattice walk implementation!

In addition to the NumPy functions mentioned above, you may also find the mean, std, and random.uniform functions useful.  Also, there is no need to create an outer loop for M.  Just use a new M and call the walk sim function in each of the three cases.

Describe what you observe about your results (plots and statistics) as the number of simulations increases from 1000 to 100,000.

3.  (9 marks) Brownian motion and Ito calculus. Let N be the number of time steps, and

ti     =   i ∆t,          i = 0, 1, . . . , N,

∆Zi     =   φ(ti)}∆t,

φ(ti)   ~   N(0, 1),

Z(t0 )   =   0,

i-1

Z(ti)   =         ∆Zj,   i = 1, 2, . . . , N.

j=0

Assume T = 2 and let ∆t = . Consider the following two stochastic sums:

I1(T, ∆t)   =

I2(T, ∆t)   =

N-1

Z(ti)∆Zi ,

i=0

N-1

Z(ti+1)∆Zi .

i=0

(a)  (3 marks) What is the theoretical value of E[I1(T, ∆t)] and E[I2(T, ∆t)], where E[·] is the expectation operator? Prove your answer.

(b)  (6 marks) Write a Jupyter/Python notebook to compute the expected value of I1(T, ∆t) and I2(T, ∆t). Use 100,000 paths, and compute the expected values using ∆t = 0.02, 0.01, 0.005, 0.0025, 0.00125 (i.e. N = 100, 200, 400, 800, 1600 time steps). Vectorize your code so that there is only one explicit for loop over the time steps. However, you are allowed to use an outer loop to go through the different values of ∆t (or N).

Write code to generate a simple text-based table of the expected value of I1(T, ∆t) and I2(T, ∆t) for the different values of ∆t.  (No fancy formatting is required. You can just use Python’s print function to generate each row, with appropriate arguments.)

Explain what you observe. Relate this to a property of Ito calculus as well as to the result in part (a).

4.  (5 marks) Ito calculus.

(a)  (3 marks) Let X(t) and Y (t) be two stochastic processes, such that

dX   =   µX (X(t), t)dt + σX (X(t), t)dZX ,

dY   =   µY (Y (t), t)dt + σY (Y (t), t)dZY ,

with dZX(t), dZY(t) being the increments for two distinct Wiener processes, ZX(t) and ZY(t). Let X(ti) = Xi  and Y (ti) = Yi. Show that

(Xi+1 . Xi)(Yi+1 . Yi) = Xi+1Yi+1 . XiYi . Xi(Yi+1 . Yi) . Yi(Xi+1 . Xi) .

Then, using the definition of the Ito integral which is the limit of a discrete sum, show that

t

X(s)dY (s)

0

=   [XY]0(t) .

t

Y (s)dX(s) .

0

t

dX(s)dY (s).

0

(b)  (2 marks) Let Z(t) be a stochastic process satisfying dZ = φ }dt, and assume Z(0) = 0. Using the result in part (a), show that (assuming Ito calculus)

t Z(s) dZ(s)   =    1 Z(t)2 . t

5.  (5 marks) Ito calculus and Ito’s Lemma.

Suppose dZ is the increment of a Wiener process and

dX = µ(X(t), t) dt + σ(X(t), t) dZ.

(a)  (2 marks) Suppose F is a function of t and the above stochastic variable X, defined as F (X, t) = e2tX3 .

What is dF (X, t) (interpreted in the sense of Ito calculus)?

(b)  (3 marks) Using dX as defined above, and expanding, simplify

T

(dX)2

0

as much as possible.  The integral is to be interpreted in the Ito calculus sense.  Note that σ(X(t), t) is a function of t, not a constant, so you will not be able to fully solve the integral.