### Matlab代写 | ECMM703 ANALYSIS AND COMPUTATION FOR FINANCE

这个作业是用Matlab进行财务分析与计算

ECMM703 ANALYSIS AND COMPUTATION FOR FINANCE

Assignment 3: Due noon, 15 January 2020

Overview and Submission information

General guidelines. Please write down your answers clearly quoting numerical values to 3

significant figures, unless otherwise stated. Full marks achieved in this assignment will contribute 20% of the final module mark. Usual University penalties apply for late submission

unless mitigation is approved. Feedback will be written on your work, and general comments

will also appear on ELE.

Submission format. Please submit paper only, (no electronic submission is required)

via BART submission. You will need to print out a BART cover sheet, staple your work to

this and then hand it in to the Harrison front desk, allowing plenty of time (given there can be

long queues at around noon). Any queries, please ask at the front desk for help. You should

print out relevant codes that you have written (e.g. scripts and functions) and relevant outputs

(e.g. graphs and plots). Analytical calculations and discussions (when asked for) can be done

by hand-writing.

Allocation of marks. When solving any particular problem, marks will be awarded for clearly

commented (Matlab) codes, and carefully reasoned mathematical solutions. Any diagrams,

graphs, etc., should be clear to understand, with good comment or clear labelling. For questions

requiring numerical simulation/output, marks will primarily be awarded for demonstrating use

of Matlab: little credit will be given for other solution schemes.

Academic Misconduct. All work submitted including functions and scripts must be your

own and not copied from other students or other sources (e.g. web pages). Any

evidence of possible plagiarism will be investigated following university procedures. You are

welcome to discuss ideas and possible methods, of course, with each other and with lecturers,

etc., but the work you hand in must be your own.

Main contact for this assignment: Frank Kwasniok (F.Kwasniok@exeter.ac.uk)

Questions

1. Study the recurrence properties of the three-state Markov chain described by the transition

matrix

T =

2/3 0 1/3

1/4 3/4 0

1/3 0 2/3

.

Consider the quantity R

(n)

i =

Pn

k=1 (T

k

)

ii. Using Matlab, plot a graph of R

(n)

i against time n

for each of the states i ∈ {1, 2, 3}. From your graphs, does R

(n)

i

remain bounded or diverge to

∞ as n → ∞?

Prove analytically the behaviour and deduce the recurrence properties. [20]

2. Consider i.i.d. random variables {Xi} drawn from a uniform distribution on [0, 1]. In the

following find scaling sequences an, bn such that an(Mn − bn) converges in distribution to a

non-trivial limit function G.

(a) Yi = Xi

, and Mn = max{Y1, . . . , Yn}

(b) Ui = 1/Xi

, and Mn = max{U1, . . . , Un}

In each case find first of all the probability distribution function P(Mn ≤ u/an + bn) as a

function of un = u/an + bn. Then find suitable scaling sequences an, bn so that you get a

non-trivial limit G(u) as n → ∞. The function G(u) will be one of three standard types. [15]

3. Recall the definitions of the excess distribution function and the mean excess function for a

random variable X with distribution function F(x) = P(X ≤ x):

Fu(x) = P(X ≤ u + x|X > u)

e(u) = E(X − u|X > u).

For the random variables considered in Question 2, compute these quantities analytically and

analyse their asymptotic behaviour as u → xF (where xF is the upper end-point of the random

variable X).

Now use Matlab to simulate 10000 realisations of the two random variables and estimate the

mean excess function with the Monte Carlo method as a function of u. Plot these estimates

against the exact results above. Comment on the comparison. [20]

4. Generate i.i.d. data from the distributions in Question 2, say, n = 10000 realisations. Divide

the data up into N blocks of size k (keeping the data in order), so that n = N k. Take the

maximum value Y

(i) of each block i so that you get N values, that is, if the data is {X1, . . . , Xn},

then we set

Y

(i) = max{X(i−1)k+1, . . . , Xik}, 1 ≤ i ≤ N.

Then apply the gevfit scheme in Matlab to this data to estimate the parameters of the GEV

distribution. How do these estimates compare to the theoretical values in Question 2?

How do these estimates depend on the block size and number of blocks? That is, you might

try keeping n fixed and vary N and k. Does there appear to be an optimal N, k to choose?

Increase N and k separately and see if/how the estimates improve. In this case you would need

to change n.

Now consider peak-over-threshold modelling. Use the scheme gpfit in Matlab to estimate the

parameters of the GPD distribution. Discuss the dependence of the estimates on the threshold

u and the amount of data n. Is the shape parameter ξ the same that you found in the GEV fit

above? [20]

5. Consider geometric Brownian motion as a simple model for asset prices described by the Itˆo

stochastic differential equation

dSt = µStdt + σStdWt

on the interval [0, T] with initial condition S0 = 1. We choose the parameter setting µ = 0.5,

σ = 0.3 and T = 2.

(a) Describe briefly the meaning of the different terms in the above model in a financial

context.

(b) Use Matlab to simulate and plot five different trajectories of the above model together in

one graph using the Euler-Maruyama scheme with step size δt = 0.001.

(c) Calculate analytically E(St) and Var(St) for 0 ≤ t ≤ T.

(d) Generate 10000 trajectories of the above model with the Euler-Maruyama scheme and

use the Monte Carlo method to estimate E(St) and Var(St). Do this with three different

time steps δt = 0.1, δt = 0.01 and δt = 0.001. Plot the three estimates of E(St) together

with the exact analytical result and do the same for Var(St). Comment on your results.

[25]

## 发表评论