You are on page 1of 9

NumXLTips&HintsVolatility101 1 SpiderFinancialCorp,2012

Volatility101
Thisisthefirstentryinwhatwillbecomeanongoingseriesonvolatilitymodeling.Inthispaper,wewill
startwiththedefinitionandgeneraldynamicsofvolatilityinfinancialtimeseries.Next,wewilluse
historicaldatatodevelopafewmethodstoforecastvolatility.Thesemethodswillpavetheroadtoa
moreadvancedtreatmentinfutureissues.
Whyshouldyoucare?Predictingvolatilityiscrucialformanyfunctionsinfinancialmarkets.Forstart,
volatilityisusedbymanyforriskmanagement(e.g.VaR),optionspricing,assetallocation,andmany
otherapplications.Understandingvolatilityisvitalforvirtuallyalltimeseriesanalysis.
Foradatasample,wewillusetheS&P500dailyreturnsbetweenJan2002andJune8,2012.All
examplesarecarriedoninExcelusingonlyNumXLfunctions.
Bytheendofthispaper,wehopetoleaveyouwithanunderstandingofthedifferenttypesofmarket
volatilityanddevelopanintuitionforvolatilitydynamics.
Background
Infinance,volatilityisameasureforvariation(i.e.risk)ofthepriceofafinancialinstrumentovertime.
Beforewegointothetypesofvolatilities,letstakeastepbackanddefineit.
Volatilityiscommonlyusedtoreferencethestandarddeviation(
2
T
o )oftheunderlyingdistribution.An
unbiasedestimateofthepopulationvariance(
2

T
o )isdefinedasfollows:

( )
2
2 1

1
T
t
i
T
r r
T
o
=

=

Where:

t
r istheholdingperiod(e.g.daily,weekly,monthly,etc.)forreturns
r isthemeanofthereturnoverthesampleperiod T
Thevolatility(orstandarddeviation)isdefinedbyaholdingperiod,soaweeklyvolatilityisdifferent
thanannualvolatility.
Furthermore,thedefinitionabovecalculatestheaveragevarianceoverthesampleperiod.Assuming
theexcessreturns(i.e.
t
r r )arestationary(orweaksensestationary),then o isagoodforecastfor
futurevolatility.Forafinancialtimeseries,dothestocksreturnsexhibitatimeinvariantvolatility?Lets
considertheS&P500dailyreturnsexample:

NumXLTips&HintsVolatility101 2 SpiderFinancialCorp,2012

S&P500Application

ThedailylogreturnofS&P500Indexexhibitscommonpatternsthatarewelldocumentedinfinancial
literatures:
(1) VolatilityClustersvolatilitymaybehighforacertaintimeperiod(redcircles)andlowforother
periods.
(2) Volatilityevolutionthevolatilityevolvesovertimeinacontinuousmanner;i.e.volatilityjumps
areveryrare.
(3) Volatilitydoesnotdivergetoinfinitythevolatilitymaygohigh(andstayhigh)insometime
periods,butsurelygoesdowntosomesteadystatevalue(longrun).
(4) Volatilitydoesnotgodowntozerothevolatilitymaybelowforaperiodoftime,butitsurely
goesuptoasteadystatelevel.
(5) Volatilityreactsmoretolargenegativereturnsthanitdoestosimilarpositiveones.
Inshort,volatilitydoeschangeovertime,butonlyasamorestationarycontinuousmeanreverting
process(Hint:ARMAprocess).
Themaintakeawayisthatthevolatilitychangesovertime,soaforecastusinghistoricalvolatility(which
ignoresvolatilitydynamics)maynotbeasrobustorindicativeforfutureones.

NumXLTips&HintsVolatility101 3 SpiderFinancialCorp,2012

Movingwindowstandarddeviation
Usinghistoricalreturns,wecancomputethestandarddeviationusingaslidingwindow(widthh).This
approachisdefinitelyanimprovementoverthehistoricalone,butwearestillmakingoneimplicit
assumption:
Theobservedvolatilityinthelasttimewindowisindicativefornextperiodvolatility.

Whatistheoptimalsizeofthemovingwindow?
Inprinciple,theshorterthewindowis,themoreresponsivethemovingstandarddeviationisto
volatilitychanges;however,itcanbeverynoisetoo.Ontheotherextreme,alargerwindowisless
noisy,butitisslowertoresponsetochangesinvolatility.Withthatinmind,whatistheoptimalvalue
thatcangiveusagoodvolatilityforecast?
Toanswerthisquestion,weneedtodevelopautility(orloss)functionthatweopttomaximize(or
minimize)byalteringthewindowsize(h).Letsformulatetheproblem:

( )
2
2 1
1

1
MA
h
t i t
i
t
h
t i
i
t
r r
h
r
r
h
o

=

= =


Where:

t
o isthevolatilityforecastusingpriorinformation
1 1
{ , ,..., }
t h t h t
r r r
+


t
r isthemovingaverageforthesamewindow
Togaugehowbadourforecastis,wewillusetherootmeansquarederror(RMSE)asourlossfunction
(i.e.thesmallertheRMSEthebetter).

2 2 2
( )
RMSE
T
t t
i h
r
T h
o
=

=

Where:

2
t
r isusedinplaceoftheactual(realized)volatility

NumXLTips&HintsVolatility101 4 SpiderFinancialCorp,2012

T h isthenumberofvolatilityforecastsavailable
Next,wellcomputetheRMSEfordifferentwindowsizesbetween2and30days,evaluatetheRMSE,
andpicktheonewiththeminimalvalue.

Intheplotabove,awindowsizeof12dayhasthelowestRMSE,afterwhichtheRMSEstabilizes.The
takeawayhereisthatthewindowsizeshouldnotbelessthan10daysforagoodforecast.
Usingmovingstandarddeviationwithawindowsize=12,letsplotthevolatilityforecast:

Themovingstandarddeviationmethodisanimprovementoverplainhistoricalvolatilityasitresponds
tochangesinvolatilityovertime,butitgivesallobservations(withinitswindow)equalweights.

NumXLTips&HintsVolatility101 5 SpiderFinancialCorp,2012

WeightedMovingWindowStandardDeviation
Anaturalextensiontothemovingaverageistoassignweightstoobservationsinthewindow;recent
observationsaregivenhigherweightfactors(similartoweightedmovingaverage)thanlaterones.
Inpractice,exponentialweightedvolatility(EWMA)isthemostcommonlyused.
ExponentialWeightedMovingAverage(EWMA)
In1992,JPMorganlaunchedtheirRiskMetricsmethodologytothemarketplace,makingtheir
substantiveresearchandanalysisinternallyavailabletomarketparticipants.EWMAispartof
RiskMetricsmethodology.

2 2 2
1 1
(1 )
t t t
r o o

= +
Where:
- istheexponentialsmoothingparameter( 0 1 s s )

( )
2 2 2 2 2 2 2 2 2 2
1 1 2 2 1 2 2 1
2 3 2 3 2 2 2
3 3 2 1
2 2 2 2 2 2 3 2 2
1 2 2 3
2
(1 ) (1 ) (1 ) (1 )( )
(1 )( )
(1 )( ... )
(1 )
t t t t t t t t t
t t t t t
k k
t t k t t t t t k
i
t
r r r r r
r r r
r r r r r
o o o o
o o
o o
o


= + = + + = + +
= + + +
= + + + + + +
=
1
1
T
i
t i
i
r


TheEWMAhasafewfavorableproperties:
1. Weightssumuptoone(1).

1
1 0
1
(1 ) (1 ) 1
1
i i
i i

= =

= = =



2. Higherweightsaregiventorecentobservations,decliningexponentiallyafterward.
InRiskMetrics,JPMorganuses 0.94 = foralmosteverything,butletscomputeanoptimalvalueof
usingthesamemethodologyintheMASDearlier.

NumXLTips&HintsVolatility101 6 SpiderFinancialCorp,2012

Theoptimalvaluefor usingtheS&P500dailyreturnsisfoundat0.90,whichisveryclosefromthe
ruleofthumbof0.94(seethegraphabove).
LetsplotthedailyvolatilityforecastusingtheEWMAand 0.90 =

ComparingtheEWMAvolatilitywithonesweobtainedinmovingwindowstandarddeviationmethod,
weseethattheyareprettyclose.However,theEWMAmethodgaveusaslightlylowerRMSEandwas
mucheasiertocalculate.
TheEWMAisanimprovementovermovingaverage(i.e.simplicity),butitalsosuffersfromafew
drawbacks,includingthefactthatitisSymmetric;thatis,largenegativereturnshavethesameeffectas
largepositiveones.Asaresult,itdoesnotcapturethevolatilitydynamics,butmerelysmoothesthe
squaredtimeseries.

NumXLTips&HintsVolatility101 7 SpiderFinancialCorp,2012

Infact,theEWMAisactuallyBrownssimpleexponentialsmoothingfunctionforthesquaredreturns,so
themultistepforecastisprettyflat(asitisinBrownsformula).

2 2 2
1
2 2 2 2 2 2
2 1 1 1 1 1
2 2
1
1
(1 )
(1 ) (1 )

T T T
T T T T T T
T n T
n
r
r
o o
o o o o o
o o
+
+ + + + + +
+ +
>
= +
= + = + =
=

NotethattheEWMAdoesnotexhibitreversiontothemeanaswell.
Conclusion
Inthispaper,westartedbydiscussingthegeneralpatternsfoundinfinancialtimeseries(e.g.clustering,
reversiontothemean,asymmetricalreactiontopositiveandnegativereturns),andfollowedthatby
introducingtwomethodsforestimatingvolatilityusinghistoricaldata:movingstandarddeviationand
exponentialweightedvolatility(EWMA).
Tocomparethegoodnessofvolatilityforecastofeachmethod,weleveragedtherootmeansquared
error(RMSE)betweenthesquareddailyreturnsandestimatedvariance.UsingRMSEasalossfunction,
wecomputedtheoptimalvaluesforthemovingwindowsizeandtheEWMAsmoothingparameter.
Furthermore,wecomparedtheRMSEvalueofeachmethodandfoundthatEWMAslightlyfits;notto
mentionitwaseasiertocalculate.
Finally,neithermethodcapturesanyofthedynamicsofthevolatilityprocess;theyareatbest
smoothingfunctionswhichgiveagoodestimateoveraveryshorthorizon.

NumXLTips&HintsVolatility101 8 SpiderFinancialCorp,2012

Appendix
Forestimatingstockvolatilityusinghistoricaldata,anumberofacademicsproposedanalternative
formulatoreplacethestandarddeviationcalculationbyleveragingdailyopenclose,dailyhilo
informationtoimprovetheestimate.Heresalistofafewofthem:
1. ParkinsonnamedafterphysicistMichaelParkinson,thismethodusesonlythedailyHILOto
estimatenextdayvolatility.

( )
2
2 1
ln ln

4 ln 2
T
i i
i
h l
T
o
=

=

Where:

i
h isthedailyhighpricelevel

i
l isthedailylowpricelevel
2. GarmanKlassdevelopedbyGramanandKlass,itusesthehigh,low,andclosepricesto
estimatevolatility.

( ) ( )
2 2
1
1
2 1 1
ln ln ln(4 ) ln ln
2
T T
i i i i
i i
h l e c c
T T
o

= =

=

Where:

i
c istheclosingpriceatthatday
3. YangZhanganextensionoftheGarmanKlassestimate,itusesopen,hi,lo,andclosepricesto
estimatefuturevolatility.

( )
( )
2 2 2 2
2
1
2 1
2
1
2 1
1
2
(1 )
ln ln
1
ln ln
1
ln ln ln ln
1
o c rs
T
i i
i
o
T
i i
i
c
T
i i i i
i i i i i
rs
k k
o c
T
c o
T
h h l l
c o c o
T
o o o o
o
o
o

=
=
= + +

| |
+
|
\ .
=

NumXLTips&HintsVolatility101 9 SpiderFinancialCorp,2012

1
0.17(1 ) k
T
=
Where:
o
i
o istheopenpriceatthatday