# BEST代写-线上编程学术专家

Best代写-最专业靠谱代写IT | CS | 留学生作业 | 编程代写Java | Python |C/C++ | PHP | Matlab | Assignment Project Homework代写

# Matlab代写 | ECMM703 ANALYSIS AND COMPUTATION FOR FINANCE

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

ECMM703 ANALYSIS AND COMPUTATION FOR FINANCE
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.