HW 04 Ans
HW 04 Ans
Department of Mathematics
Columbia University
Harvey J. Stein
Head, Regulation and Credit Risk
Quantitative Risk Analytics
Bloomberg LP
Fall 2015
Compilation: October 14, 2015 at 02:13
Math G4802
Fall 2015
1. Parametric VaR, 1 stock The mean and standard deviation of the daily log returns
of a stock are S 0.03% and 1.30%, respectively. Suppose the stock follows a geometric
Brownian motion with parameters and , so that
dSt = St dt + St dWt
where Wt is a standard Brownian motion.
(a) What are good estimates for the drift and volatility, and , respectively?
Solution:
Denote the mean and the standard deviation of the daily log returns by
and
. Let t be the length of the return period. The relationship between the log
return statistics and the GBM parameters is given by:
=
/ t
=
/t + 2 /2
Plugging in
= 0.0003,
= 0.013, and t = 1/252, we get:
=
252 = 0.20637
=
252 + 2 /2 = 0.09689
(b) What is the 1 day 99% VaR of a position of 10,000 shares in the stock if the current
stock price is $55 a share?
Solution: See hw04p1.ods.
The formula for the VaR of a stock is:
VaR(S, T, p) = S0 S0 eX
2
X = T 1 (1 p) + ( )T
2
In our case, S0 = 55, T = 1/252, p = 0.99, = 20.6% and = 9.69%. The
VaR for 10,000 shares of S will be 10, 000 VaR(S, T, p).
Page 2 of 12
Math G4802
Fall 2015
2
X = T 1 (1 p) + ( )T
2
p
0.2062
)(1/252)
= 0.206 1/2521 (0.01) + (0.0969
2
= 0.0129768 1 (0.01) + 0.0003003254
= 0.0129768 (2.326347874) + 0.0003003254
= 0.029888
The VaR is then
10, 000 $55 (1 e0.029888 ) = $16, 195
:
45000.00
:
45051.62
: 2034679229.06
:
5030729.68
:
2242.93
:
-2.0537
Page 3 of 12
Math G4802
Fall 2015
3. Calibration
For this and the remaining problems, let A be Apple stock, and I be IBM stock. Their
historical values are in the StockPrices.ods spreadsheet.
Let (S, t, l) and (S, t, l) be the estimated drift rate (mean) and relative volatility
parameters for a GBM process S computed on date t using the last l years worth of
observations (i.e. assume dS = Sdt + SdW and that and are constant over that
set of observations).
Tabulate and graph (S, t, l) and (S, t, l) for S = A and S = I for t ranging over the
last 20 years, and l being 2, 5, and 10 years, using unweighted fitting. Use adjusted
closing prices.
Why are the computed parameters over time comparable even though the value invested
varies?
How stable do the results look?
Solution:
Solution for this problem and the next one (to be split up).
See spreadsheet hw04est.ods and hw04est.gp.
This and the next problem can be done with spreadsheets, but I dont recommend
it. If you try you will see that the spreadsheets get quite big. They are usable in
Excel, but extremely slow in LibreOffice.
Steps for windowed means and averages:
1. Copy the data from the data spreadsheet
2. Set up columns with log returns and log returns squared
3.
For each window, the GBM vol () is the STDEV() of the log returns times
252.
4. For each window, the GBM drift () is the average of the log returns times 252
+ 2 /2.
Page 4 of 12
Math G4802
Fall 2015
5. Set up a column with these formulas on the next 252 2 log returns to the
GBM parameters for 2 year windows
6. Do the same for 252 5, and 252 10 to get the GBM parameters for the 5
year and 10 year windows.
Steps for exponentially weighted means and variances (easy, but slow method):
1. Make a column of the powers of lambda
2. Use SUMPRODUCT() to compute the dot product of the entire log return
column starting at that date with the powers of lambda.
3. For large enough lambda, the weights drop off fast enough that we can approximate with a large window, such as with 3,000 samples.
4. Dont forget to divide by the sum of the powers of lambda to get the weighted
average
5. For the sample sigma, do the same on the square of the log returns, then
subtract the square of the mean, and take the square root.
6. Then apply the formulas for converting the sample mean and average to the
GBM parameter estimates.
I dumped the results to a .csv file and plotted them with the above gnuplot script.
Here are the results:
APPL vols
90
2yr
5yr
10yr
80
70
60
50
40
30
20
1994
1996
1998
2000
2002
2004
2006
Page 5 of 12
2008
2010
2012
2014
2016
Math G4802
Fall 2015
APPL mu
140
2yr
5yr
10yr
120
100
80
60
40
20
0
-20
-40
-60
1994
1996
1998
2000
2002
2004
2006
2008
2010
2012
2014
2016
IBM vols
50
2yr
5yr
10yr
45
40
35
30
25
20
15
10
1994
1996
1998
2000
2002
2004
2006
Page 6 of 12
2008
2010
2012
2014
2016
Math G4802
Fall 2015
IBM mu
70
2yr
5yr
10yr
60
50
40
30
20
10
0
-10
-20
-30
1994
1996
1998
2000
2002
2004
2006
2008
2010
2012
2014
2016
80
70
60
50
40
30
20
10
0
1994
1996
1998
2000
2002
2004
2006
Page 7 of 12
2008
2010
2012
2014
2016
Math G4802
Fall 2015
300
200
100
-100
-200
-300
-400
1994
1996
1998
2000
2002
2004
2006
2008
2010
2012
2014
2016
45
40
35
30
25
20
15
10
1994
1996
1998
2000
2002
2004
2006
Page 8 of 12
2008
2010
2012
2014
2016
Math G4802
Fall 2015
60
40
20
-20
-40
1994
1996
1998
2000
2002
2004
2006
2008
2010
2012
2014
2016
250
200
150
100
50
0
1994
1996
1998
2000
2002
2004
2006
Page 9 of 12
2008
2010
2012
2014
2016
Math G4802
Fall 2015
800
600
400
200
0
-200
-400
-600
-800
-1000
1994
1996
1998
2000
2002
2004
2006
2008
2010
2012
2014
2016
90
80
70
60
50
40
30
20
1994
1996
1998
2000
2002
2004
2006
Page 10 of 12
2008
2010
2012
2014
2016
Math G4802
Fall 2015
120
100
80
60
40
20
0
-20
-40
-60
1994
1996
1998
2000
2002
2004
2006
2008
2010
2012
2014
2016
Computed parameters are comparable over time because they are for GBM. In GBM,
the drift and variance are relative to the stock price (i.e. expressed as a percentage
of the stock price). Hence, if the parameters are stable, then they are independent
of the level of the stock and hence are comparable over time.
Observations:
The 2 year results are very jumpy.
The 10 year results look too smooth they adapt very slowly to changing
environments.
The 5 year results look usable.
The = .94 and = .97 results are far too noisy to be useful.
The drift estimates are much more noisy than the volatility estimates with the
same size window.
The drift estimates have a much greater variance than the volatility estimates.
Different choices of parameters (lambda and window size) yield substantially
different estimates for the drift and volatility.
The noise exhibited in the drift estimates indicates why drifts are often assumed to
be zero in calculations.
Page 11 of 12
Math G4802
Fall 2015
4. Exponential weighting
Repeat the previous problem using exponential weighting, with = 0.94 and = 0.97.
Solution:
See previous solution which includes results for this problem.
Page 12 of 12