# 辅导data编程、辅导Python，C++程序

Individual Question for Student with Keats ID
21201322
Problem Setup
A trader knows that the price of a stock, St, will evolve according to the stochastic differential equation:
dSt = µSt dt + σ(t)St dWt.
Here µ is a constant, σt is given by the deterministic function
σ(t) = (
0.14 + 0.14 ×
t
0.60 t < 0.60
0.28 otherwise
,
and Wt is a Brownian motion.
A trader manages a portfolio of options, the stock and a risk free bankaccount and rebalances the portfolio at times t ∈ T := {0, δt, 2δt, . . . , Nδt = T}.
They ensure that at each time t ∈ T \ {T} they are holding q1 + q2∆t units of
the stock and q3 units of an option with payoff
max{−ST + 181, 0} + max{−ST + 104, 0}
and maturity T. Here, ∆t is the delta of the option.
They start with an initial bank balance b0 and withdraw the money needed
to make any purchases from this account and place the proceeds of any sales
into the account. The bank account is risk free and grows with continuously
compounded constant interest rate r. At time T they liquidate their stock and
options holdings and place all the proceeds in the bank balance, to obtain bT .
The quantities q1, q2 and q3 are constant real numbers.
You should assume that the price of the option in this model can be computed
using the formula for the equivalent option in the Black–Scholes model but
substituting the value σt,T in place of the volatility in the Black-Scholes formula
where
σt,s := s
1
s − t
Z s
t
σ(u)
2 du.
As well as only being able to follow the strategy described above the trader
must pay transaction costs. These are given by a charge equal |q|θSt for buying
or selling q units of the stock at time t.
In this exercise you should estimate the values q1, q2 and q3 which maximize
the trader’s expected utility assuming that their utility function is given by
u(bT ) = − exp(−λbT ) and where bT is their final bank balance. When performing numerical optimization it is important to choose a sensibly scaled objective
function, for this reason it is recommended that you optimize the equivalent
quantity
φ = −
1
b0λ
log(−E(u(bT )).
1
Your answer should take the form of an essay and should cover the following
points:
1. How St can be approximately simulated using the Euler–Maruyama scheme
for St.
2. How St can be exactly simulated using the alternative scheme described
below. You should use this exact method to generate M simulations of
S
α
t where the index 1 ≤ α ≤ M denotes the scenario.
3. You should generate a plot which shows how accurately the mean of ST
can be estimated using the Euler-Maruyama scheme for different step sizes
δt. You should use M simulations of ST to estimate the mean.
4. You should discuss the financial interpretation of the trading strategies
when all but one of the qi
’s are equal to zero.
5. You should provide all the difference equations needed to compute b
α
T
, the
final bank balance in scenario α.
6. You must give a clear mathematical statement of the optimization problem
you have solved, including details of any approximations you have used.
7. You should discuss the accuracy of any approximations you have used.
8. When θ = 0, how do the optimal quantities depend upon the value of δt?
9. When θ = 0, how do the optimal quantities depend upon the value of λ?
10. You must START your essay by including a completed version of the table
of results shown in 2 where the quantity φ(q1, q2, q3) denotes the value of
φ obtained for a given set of quantities. The parameter values you should
use are given in 1. The prices quoted for the options will not correspond
to the model the trader is using, you can assume that the trader has some
inside information.
Exact simulation method
Suppose that for a fixed grid size δt, z0 is given and that for t ∈ T zt+δt =
(µ −
1
2
σ
2
t,t+δt)δt + σt,t+δt

δtt where the t are independent, identically distributed normal random variables and a is a constant. You should show that
zt is normally distributed with a mean and variance that do not depend upon
δt. You may then assume that if we simulate zt in this way it gives an exact
simulation for the stochastic differential equation
dzt = (µ −
1
2
σ
2
t
) dt + σt dWt.
You should be able to use this fact in order to devise a method to simulate St
exactly.
2
Parameter Value
b0 129.00
S0 140.00
µ 0.14
r 0.04
T 1.40
θ 0.01
N 32.00
M 100000.00
λ 0.01
Option bid price at time 0 41.36
Option ask price at time 0 42.17
Table 1: Parameter values
Keats ID 21201322
φ(0, 0, 0)
φ(1, 0, 0)
φ(0, 1, 0)
φ(0, 0, 1)
Optimal φ
Table 2: Required table of results
3