Documentos de Académico
Documentos de Profesional
Documentos de Cultura
ln(1 + R)
t
1
Formula 1-A6-1 RSGT or the annualiWation o! the
interest rate % accrued during the time tD
Bote that the MZ that was yielded a!ter the three months are called
`Puarterlya &i$pl# r#t!rn. The average (or the arithmetic mean) o! the
simle returns over several eriods is called arith$#tic r#t!rnD The
arithmetic return is an imortant number !or a series o! bets (or trades)
witho!t reinvestment o! winningsD It is also used to !ind the otimal
ort!olios (sD the chater on Kelly criterion)D #ut in order to characteriWe a
series o! trades with reinvestments we need RSGT or- alternatively- a
g#o$#tric $#an return over several eriods (RSGT is more convenient
since it also allows to comare two strategies with di!!erent investment
eriods)D
A7: It holds (1 +r)
5
= 2 thus according to the !ormula ?JSLJ?
r = 0:14870 which is retty ambitiousD Uor comarisonN the fSY
(German counterart o! fow Jones Industrial Sverage) has a longJ
term RSGT about IZD \n the other hand "arren #u!!et achieves
=>Z RSGTD
A8: This Puestion is not trivialD S correct but an incomlete answer
is as !ollowsN one in a thousand is >D?Z thus the robability o! the
allergic resonse is also >D?ZD Sccording to Thilo FarraWin only @LZ
??
o! Germans and =MZ o! Smericans can rovide this answer
E
D The
roblem is- however- that >D?Z is [ust an emirical estimation o! the
`genuinea robability but not the genuine robability itsel!D The
more the number o! trials (in this case the number o! ersons that
took the medicine) the better is the convergence o! the estimate to
the genuine robabilityD The underlying theory is !ar !rom being
easyD Uortunately there is an accessible alternativeN the Monte Rarlo
simulation- which will be one o! the most imortant tools !or usD
A9: Smong KL cards there are @ PueensD Uor a wellJshu!!led deck
each card can be drawn with ePual robability- which is ?OKLD In
!our cases there can be a Pueen- so the total robability is @OKL o
?OH o ??D??ZD Snalogously there are H sades thus the robability
to get a sade is ?O@ o =MZD Uinally- there is only one Pueen o!
sades- so the robability to get it is ?OKL o =DEIZD Bote that the
suit o! a card is obviously indeendent !rom its valueD \n the other
hand the robability to draw the Pueen o! sades is numerically
ePual to the roduct o! robabilities to draw a Pueen and to draw
sadesD In general- i! the events S and # are indeendent then the
robability that both S and # will occur is ePual to the roduct o!
their robabilitiesD Moreover- the converse is also true- iDeD i! the
!ormula ?JSHJ? holds then the events S and # are indeendentD
P(AB) = P(A)P(B)
Formula 1-A9-1 Qrobability law !or indeendent events
A10: This case is a er!ect demonstration o! the VcontradictionsV
between the emirical and the genuine robability or- as some
eole say- between mathematics and hysicsD S VhysicistV will
conclude that the coin is heavily biased- so the robability to get a
E
TD FarraWin- Vfeutschland scha!!t sich abVD Lth ed(=>?>)- D ?HL
Thilo FarraWin (born in ?H@M) was a very success!ul senator !or !inance in #erlin
and a member o! the bXecutive #oard o! the German Rentral #ank (#undesbank)D
?=
head by the neXt toss shall be close to ?D Cowever- a
VmathematicianV will assume a !air coin and thus state that the
robability to get a head by the ??th toss is still >DM- since the toss
outcomes are indeendent !rom each other
I
D Bote that i' the coin is
!air- the robability to get ?> heads by ?> tosses is- according to the
!ormula ?JSHJ? ePual to (0:5)
10
= 0:0009765625 0:1%D It is
eXerience and not mathematics that lets us decide whether to
consider an event virtually imossible or retty rare but still
ossibleD In case o! a 'air coin I would rather say- it is virtually
imossible to get ?> heads by ?> tossesD #ut an allergic reaction o!
one atient among one thousand does not imly (at least to me)
that the allergy is virtually imossible- though the robability o! this
event is >D?Z as wellDDD Rontinuing on with this idea- there is one
more eXamle- which I learnt !rom the wonder!ul teXtbook on
robability theory by blena "enWel
H
N i! you are an artillerist- you
likely can accet that one o! a thousand shells will not eXlode by
hitting a targetD #ut i! you are a aratrooer- the robability o! >D?Z
to have your arachute undeloyed will likely be too high !or youD
A11: The !irst bank account ays LZ return to the end o! the yearD
The second ays o!! (1 + 0:03)
2
= 1:0609 (!irst ayment takes lace
a!ter siX months and the second to the end o! the year)D
Snalogously !or the third account we have (1 + 0:015)
4
= 1:06136
and (1 + 0:005)
12
= 1:06168 !or the !ourthD Fo there is a di!!erence-
although not really a big oneD "hat i! we continue this rocess to its
limit (and does this limit eXist at all)lq res- it doesq This is known as
contin!o!&ly co$po!nd#d int#r#&t and it is very oular in the
theory o! mathematical !inanceD
lim
n!1
1 +
r
n
t
n
= exp(rt)
Formula 1-A11-1 Rontinuously comounded interest
I
In other words they are serially indeendentD
H
blena Fergeevna "entWel (?H>EJ=>>=) was a rominent Foviet mathematician
and writer (she wrote under seudonym ID Grekova that literally means VMrsD rV)D
?K
"e can also obtain the !ormula ?JS??J? the other way aroundD
Sssume that the wealth in a bank account grows roortionally to
its current value W
t
with coe!!icient r- iDeD the !ollowing di!!erential
ePuation holdsN dW
t
= rW
t
dtD The solution is W
t
= W
0
exp(rt)
where W
0
is the initial wealthD
Aery close is the idea o! the logarith$ic r#t!rn&- iDeD i! the initial
wealth was W
0
- the terminal wealth is ePual to W
1
and the
investment eriod was t years then the logarithmic return is
r =
1
t
ln
W
1
W
0
=
ln(W
1
) ln(W
0
)
t
Formula 1-A11-2 dogarithmic returns
Indeed- i! the interest is comounded continuously then
W
1
= W
0
exp(rt) thus ?JS??JS= holdsD dogarithmic returns are
convenient !or continuous time models
?>
D Fince the stock trading is
essentially discrete- we will mostly use comound returns according
to ?JSLJ?D
Bow we turn to the robability theoryD Ss you may know- it
originates !rom gamblingD The easiest case is a symmetric coinN the
robabilities o! head (C) and tail (T) are both ePual to >DMD Cowever-
the Puestion Vwhat is the robability to get at l#a&t one head i! we
toss a symmetric coin twiceV is not comletely trivialD Ftill we can
enumerate all ossible outcomesD They are CC- CT- TC and TTD The
!irst three outcomes suit our criterionD Fince the coin is symmetric-
they all have the same robability- which is ePual to >D=M] recall that
the robabilities o! all ossible (and mutually eXclusive) outcomes
?>
In articular due to the !act that a comound return on a long and nonJ
leveraged osition can take values in `J?- 1a- whereas a logarithmic return can lie
in `1- 1a and thus can be straight!orwardly modeled by continuous robability
distribution like the normal distributionD
?@
must sum to oneD Thus the robability o! the event to get at least
one head by two tosses is >DEM or EMZD
Fo !ar so good but what i! we want to calculate- say- the robability
to get at least L> heads by ?>> tosseslq The enumeration o! the
outcomes does not seem to be !easible anymoreD "e still could
have solved this roblem analytically but we actually need notD
Instead we can engage T- an oensource and royaltyJ!ree statistical
so!twareD
jeXact value
rint(VbXact FolutionV)
? J binom(MH- ?>>- >DM)
jaroXimate value by Monte Rarlo simulation
tosses o rbinom(?>>>>>- ?>>- >DM)
nFuccess!ul\utcomes o >
!or(i in ?N?>>>>>)
s
i!(tosses`ia toL> )
nFuccess!ul\utcomes o nFuccess!ul\utcomes _ ?
u
rint(VSroXimate FolutionV)
nFuccess!ul\utcomes O ?>>>>>
R-code 1.1 Qrobability o! at least L> heads by ?>> tosses
I! you never heard about T be!ore- donmt worryD Fo !ar [ust go to
httNOOwwwDrJro[ectDorg- download and install T (the installation
on "indows is straight!orward) and enter the TJcode ?D? to the
command lineD Uurther we will learn the basics o! T iteratively ste
by steD det us discuss the TJcode ?D? in detailD The command
binom(MH- ?>>- >DM) in the Krd line gives the eXact value o! the
robability that there will be no more than MH heads by ?>> tosses
o! a symmetric coin (>DM stands !or the robability o! head)D
Tesectively- the robability that there will be L> or more heads is
? J binom(MH- ?>>- >DM) D
Cere we made use o! our knowledge o! the robability distributionD
#ut this will not always be the caseD Uor eXamle- we may draw the
stock returns !rom a (sohisticated) distribution and have no idea o!
?M
the distribution o! terminal wealth (though the distribution o!
returns is known)D #ut it is absolutely no roblem as long as we
have T at hand
??
D Sll we need to do is [ust to run a Monte Rarlo
simulation- which is- in our case- nothing else but a comuter
simulation o! the coin tossesD The command
tosses o rbinom(?>>>>>- ?>>- >DM) tells T to simulate ?>> tosses o! a
symmetric coin- calculate the sum o! heads- reeat the rocess
?>>>>> times and ut the values to the array VtossesVD Rommand
nFuccess!ul\utcomes o > initiates the counter o! outcomes with L>
heads or moreD Then we run through all outcomes with a 'orJloo
and check whether we got the desired number o! headsD I! yes- we
increment n(!cc#&&'!l)!tco$#& by oneD In the last code line
nFuccess!ul\utcomes O ?>>>>> we divide the number o! success!ul
outcomes by the total number o! trialsD The more it is- the better
the !inal result converges to the genuine robability o! the event to
get L> heads or moreD
In my case the genuine robability was >D>=I@@KHE (and will
obviously be the same in your case)D Ss to the aroXimate
robability- I yielded >D>=IHL which is retty close to the genuine
valueD Cowever- in your case it will be slightly di!!erent- though
most likely also close to the true valueD
I! you are comletely new to rogramming- do the !ollowingN
?D Tead more about arrays (in rincile- an array is [ust a
sePuence o! values)D
=D Tead about loos (loos are used to reeat the same or the
similar actions many times)D #esides 'orJloo- learn also whil#J
looD
KD dearn the conditional oerator i' and its eXtension i' ... #l&#
as well as logical oerators and- or- not (in T they are-
resectively- written as **- ++- ,) D
@D Bote the di!!erence o! the assignment oerator o
and its synonym vJ vsD VePual toV oerator oo D
Exercie 1.1 !"ro#rammi$#%
??
The only roblem we may encounter is the comutational intensityD
?L
#y means o! this simle Monte Rarlo simulation we
addressed two imortant toicsN the (discrete) stochastic rocesses
and (the convergence to) the eXectation o! a random variableD det
us so !ar ostone the !ormer and discuss the latterD I! we assign ?
to head and > to tail- the eXected value o! a single coin toss is >DMD
Tecall the de!inition o! the eXectationN
E[X] :=
n
P
i=1
p
i
X
i
&e'i$i(io$ 1.1 bXectation o! a discrete random variable
where X
i
is the value o! a random variable in case o! outcome i and
p
i
is the robability o! this outcomeD In our eXamle let
?=
X
1
:= fX = Tg = 0- X
2
:= fX = Hg = 1
Fince the coin is symmetric- p
1
= p
2
= 0:5 and
E[X] = p
1
X
1
+p
2
X
2
= 0:5 0 + 0:5 1 = 0:5
Bote that sometimes we can calculate the eXectation [ust by
intuition
?K
D Indeed- i! we toss a symmetric coin ?>> times- we
should get aroXimately the same number o! heads and tailsD Fince
we assigned ? to head and > to tail- the eXectation is M>D
Bow let us note a very imortant idea- which you (or your
instructor) may have missed out in your !irst course on robabilityD
In case o! a single toss (or [ust a !ew tosses) the eXectation is not
really meaning!ulq
?=
VNoV means VePual by de!initionVD The eXression X
1
:= fX = Tg is read as
!ollowsN by de!inition let the !irst outcome take lace when we got a tail by a coin
tossD
?K
#ut be care!ul- in mathematics the intuition can easily let you downq Thatms why
always veri!y it by a Monte Rarlo simulationq
?E
Indeed- the eXectation is [ust the average value- but does
averaging really make sense in case o! [ust one coin tossl The
situation radically changes i! we toss a coin many times (the more-
the better)D #y hundred tosses the robability to get #xactly the
eXected value- iDeD M>- is about IZ which does not seem to be very
largeD Cowever- the robability that the outcome deviates !rom the
eXected value by no more than w?> is more than HMZq rou can
check it with T command binom(L>- ?>>- >DM) J binom(KH-?>>->DM) D
It means that in a sense th# rando$ o!tco$# -#co$#& l#&& and l#&&
rando$ a& w# incr#a&# th# n!$-#r o' trial&D In other words the
mean value o! the eXeriment converges to its eXectationD
Cere we smoothly ste to the neXt imortant concetN the variance
and the standard deviation (that are direct relatives o! the assets
volatility)D det us slightly modi!y our eXamleN instead o! a coin toss
consider a stock S- which can either !all MZ down or grow ?>Z uD
Uurther let stock # go either K>Z u or =MZ downD Bote that in
ractice we can o!ten estimate these numbers relatively recisely
and even d#'in# them- eDgD i! we set our take ro!it and sto loss
orders accordingly
?@
D det the robabilities
?M
o! both events be >DMD
Sccording to the de!inition ?D? both stocks have the same eXected
returnD IndeedN 0:5 0:1 + 0:5 (0:05) = 0:025 = 2:5% and
0:5 0:3 + 0:5 (0:25) = 0:025 = 2:5%D
Cowever- you (should) intuitively !eel that the stock # is much more
riskyD Indeed- !or both stocks we eXect the same return but we
know that by the stock S we will not lose more than MZ o! our
investment even in the worst caseD \r in other words- the worst
ossible deviation !rom the eXected return is ePual to
JEDMZD #ut !or the stock # it is J=EDMZq
?@
\! course there is always a chance that the traded asset will reach neither sto
loss nor take ro!itD Cowever- eXerienced traders rarely encounter this case-
later we will discuss whyD
?M
Ss to the robabilities- they are really hard to estimateD Cowever- it is not an
insuerable hindranceD dater we will consider how to deal with itD
?I
St this oint we are getting somewhat messy since we miX the
variance and the (maXimum) drawdown riskD They are not the
sameD Cowever- as long as the returns never deviate too !ar !rom
their eXectations
?L
- the drawdown risk and the variance are very
closely relatedq rou will see this in the neXt chaterD
Fto reading !or a while and have a cu o! teaD Imagine that
you have lost MZ o! your savingsD Cow do you !eell Bow
imagine that the loss is =MZD Cave you lanned to buy a house
or a new carl \r maybe an eXensive vacationl "hich loss
would be accetable !or you so that you still could a!!ord all
your lansl
Exercie 1.2 !"yc)olo#y%
Bow let us !ormally de!ine the variance and the standard deviationD
VAR[X] := E[(X E[X])
2
]
&e'i$i(io$ 1.2 Aariance o! a random variable
StdDev[X] :=
p
VAR[X]
&e'i$i(io$ 1.3 Ftandard deviation o! a random variable
bssentially- th# &tandard d#.iation $#a&!r#& th# di&p#r&ion o' th#
o!tco$#& 'ro$ th#ir #xp#ct#d .al!#D rou may wonder why we at
!irst consider E[(X E[X])
2
] and then take the sPuare root instead
o! simly considering E[(X E[X])]D Ss a matter o! !act-
E[(X E[X])] = 0 (as a good eXercise- rove this statementq Just
aly the de!inition ?D?D Ss a use!ul corollary you will get that
?L
\r- in mathematical terms- as long as the return distribution has no !at tailsD
?H
E[E[X]] = E[X] and- in general- the eXectation o! a constant is
this constant itsel!)D Sdditionally- the advantages o! the de!initions
?D= and ?DK become evident as soon as one encounters the lin#ar
r#gr#&&ionD
det us calculate the variance o! returns on stocks S and #D Uor
convenience- we summariWe the ossible outcomes and their
robabilitiesD In other words- we seci!y the robability
distributions !or the random returns o! the both stocksD
Qrobability Teturn on stock S Teturn on stock #
>DM J>D>M J>D=M
>DM >D? >DK
"e have already calculated that E[A] = E[B] = 0:025 Sccording to
the de!initions ?D= and ?DK- we calculate
VAR[A] = 0:5 (0:10:025)
2
+0:5 (0:050:025)
2
=
0:005625
VAR[B] = 0:5 (0:30:025)
2
+0:5 (0:250:025)
2
=
0:075625
Cence StdDev[A] = 0:075 and StdDev[B] = 0:275
=>
Chapter 2: Money Management according to Kelly
criterion: the first encounter
bvery highly Puali!ied telecommunication engineer knows
the (basics o!) in!ormation theoryD This theory does not tell him
how to design the devices with the maXimum bandass but it does
tell him which bandass he can theoretically achieveD Fince our
engineer is highly Puali!ied- he knows that ractically achievable
bandass will be somewhat below the theoretical oneD
"e J the !inanciers J have our own analogue o! the in!ormation
theory that tells us- which maXimum eXected growth rate- iDeD
which RSGT- we can achieve in the long termD This V!ortunems
!ormulaV is known as Kelly criterionD Furrisingly- it was Rlaude
Fhannon (the !ather o! the in!ormation theory)- who signi!icantly
contributed to its discoveryD bven more surrising is that very !ew
!inancial ro!essionals are (really) aware about Kelly criterionD St
the same time every gambler knows itD
S short historical review o! Kelly criterion is Puite aroriate
here
?E
D The original aer VS Bew Interretation o! In!ormation
TateV
?I
was written by JD dD Kelly- JTD in ?HMLD In essence- it considers
a !avorable game
?H
and the otimal !raction o! gambling caital-
which one should bet by each stakeD #ut !rom the tradersm and
bettorsm oint o! view the ublished version is retty vagueD Though
one can gras the main idea- the aer is rather about
communication channels than about otimal stakesD Sllegedly-
there was an earlier version- written both by Kelly and FhannonD In
this version the author(s) !reely talked about bookies and insidersD
#ut both authors worked !or STxT- whose management Vwas never
?E
Uor the most art I !ollow James Rasems aer VThe Kelly RriterionN Uallacy or
Kuhnian Qaradigm Fhi!t "aiting to CaenlV (FISM Bews- Aolume KH- Bumber K-
Sril =>>L- available at httNOOwwwDsiamDorgOd!OnewsOHK>Dd!)
?I
Svailable at httsNOOwwwDrincetonDeduOywbialekOromeOre!sOkellykMLDd!
?H
Uavorable game is a game with a ositive eXectationD The simlest case is
tossing o! a nonJsymmetric coinD \ositely- in case o! a symmetric coin the
eXectation is Wero- so one seaks about 'air gameD
=?
keen to advertise the !act that bookies long reresented an
embarrassingly large !raction o! the !irms customer baseVD Ss a
result- the authors reared a Vmore olitically correctV version-
signed by Kelly aloneD
S coule o! years later bdward Thor
=>
- a ro!essor o! mathematics
at MIT !ound out how to get an edge in black[ackD Fhannon was a
good !riend o! Thor and drew his attention to Kellyms aerD Kellyms
aroach allowed Thor to maXimiWe in long t#r$ the advantage o!
his edge in black[ackD Thor alied his strategy in das Aegas casinos
and made good moneyD Fuccess!ul gamblers are Puickly recogniWed
and eXelled !rom casinos- so Thor had to disguise himsel! in a
combination o! wraaround glasses and a beard in order to avoid
eXulsionD
ret a casino a!!air was [ust a warmJu !or ThorD Cis real deal was
the statistical arbitrage- iDeD the eXloration o! the market
imer!ections that though not necessarily guarantees a riskless
ro!it but rovides a sure edge Von averageVD In an e!!icient market
there are no such imer!ections but Thor never believed the
markets were e!!icientD zzIn the late ?HE>s a!!ordable- ower!ul
comuters and high Puality databases were becoming more
a!!ordable- making a revolution in Uinance ossibleDDD The idea was
to rank stocks by their ercentage change in rice- corrected !or
slits and dividends- over a recent ast eriod such as the last two
weeksD "e !ound that the stocks that were most u tended to !all
relative to the market over the neXt !ew weeks and the stocks
which were the most down tended to rise relative to the marketD
csing this !orecast our comuter simulations showed aroXimately
a => ercent annualiWed return !rom buying the best decile o!
stocks- and selling short the worst decile
=?
{{D Qro!D Thor is a
seminal writer] however- he never disclosed in d#tail how he
alied Kelly criterion to his ort!olio o! $any assetsD "e will
=>
httNOOenDwikiediaDorgOwikiObdwardk\DkThor
=?
bd Thor- S Mathematician on "all FtreetD Ftatistical Srbitrage J Qart IID
httNOOwwwDwilmottDcomOd!sO>I>LK>kthorDd!
==
discuss this issue later but so !ar consider the Kelly criterion in its
simlest univariate !ormD
Sssume a gambler tosses a biased coin so that the
robability p to get a tail is known and larger than >DMD (In our
terms- it is a !avorable game and a gambler has an edge)D S!ter each
bet a gambler loses or doubles the money at stakeD \bviously- he
wants to eXloit his edge comletely and at !irst glance the idea to
maXimiWe his #xp#ct#d t#r$inal w#alth (recall de!inition ?D?) does
not look imlausibleD det W
0
be his initial caital and let ! be the
!raction that the gambler bets at each stakeD Tesectively- he lays
aside (1-!)D Then the eXected caital a!ter the !irst bet is
W
0
[2pu + (1 p) 0 + (1 u)] = W
0
[2pu + 1 u]
Tesectively- the eXected caital a!ter the second bet is
W
0
[2pu + 1 u]2pu +W
0
[2pu + 1 u](1 u)
= W
0
[2pu + 1 u]
2
Uor n bets one has E[W
n
] = W
0
(2pu + 1 u)
n
D \bviously- this
eXression is growing with ! (recall- p t >DM thus p t ?)D Thus in
order to maXimiWe the eXected terminal wealth a gambler should
ut at stake all his caital by each betD Cowever- this is too risky
because each bet looms the danger to lose everything and as the
number n o! bets gets larger and larger a gambler will eventually go
bankrut (recall n?> !rom the PuiW)D Thus | i! the winnings are r#-
in.#&t#d J the idea to maXimiWe the eXected terminal wealth is
actually bad and our gambler needs another aroachD \n the
other hand i! he bets nothing (iDeD lets ! o >) he will make no use o!
his edgeD Fo the otimal !raction is somewhere between Wero and
one- but wherelq
Ss an alternative to the maXimiWation o! the eXected terminal
wealth- Kelly suggested to maXimiWe the #xp#ct#d growth rat#
(recall nM and nE)D Indeed- one can make an outstanding series o!
returns- say =>Z- K>Z and I>Z- which corresonds to a total return
o! (?_>D=)(?_>DK)(?_>DI) J ? o ?I@Zq
#ut then one may have a bad luck and get a return o! JE>ZD Then
the total return will be JK@D@IZ (recall nM)q In this sense the
=K
maXimiWation o! the eXected growth rate means that we limit the
a!termath o! severe negative returns- because [ust one such
negative return can drastically reduce our wealthD St the same time
we su!!iciently articiate in ositive returnsD Thus in the long run
Kellys aroach beats any oth#r aroachq
Ss you may have noted- in case o! reJinvestment o! winnings the
wealth grows eXonentially in time- iDeD the time (or the number o!
investment eriods) stays in the eXonent (recall !ormula ?JSLJ?)D
Thus the maXimiWation o! the eXected growth rate actually means
the $axi$i"ation o' #xp#ct#d logarith$ic t#r$inal w#alth ln(W
n
)D I!
we hold an asset !or n eriods !or which the returns are random
than we have
W
n
= W
0
(1 +r
1
) (1 +r
2
) : : : (1 +r
n
)
Taking logarithm we turn this roduct into a sum and maXimiWe
E[ln(1 +r
1
) + ln(1 +r
2
) +: : : + ln(1 +r
n
)]
S reader- who is !amiliar with utility !unctions- will readily ask
whether we [ust maXimiWe the logarithmic utilityD In a sense- yes-
and Kelly did recogniWe this asect o! his aroachD #ut he always
ointed at the !act that his argumentation has nothing to do with
utility !unctions and this connection to the logarithmic utility is [ust
a coincidenceD Cowever- it is a very hay coincidenceq Uirst o! all
because the logarithmic utility is $yopic