Skip to main content

LUP Student Papers

LUND UNIVERSITY LIBRARIES

Outlier-Robust Dynamic Portfolio Optimization based on Bear-Bull-Regimes

Eliasson, Emil and Hamlin, Linus (2018) FMS820 20181
Mathematical Statistics
Abstract
The work in this thesis is meant to improve an existing algorithm described in Nystrup
(2017). As the original model uses a normal distribution to approximate the daily
logarithmic returns, the authors of this thesis aim to improve the approximation
by using Student’s t-distribution which may be a better approximation of financial
data. The algorithm uses a two state hidden Markov model to estimate the current
state (also known as regime) of the market, bull or bear. Based on the estimation,
predictions of future returns are made. The algorithm will then use this information
to trade a risky asset, in this case the S&P 500 stock index. A portion of the available
capital will be placed in the asset and the rest will be held in cash... (More)
The work in this thesis is meant to improve an existing algorithm described in Nystrup
(2017). As the original model uses a normal distribution to approximate the daily
logarithmic returns, the authors of this thesis aim to improve the approximation
by using Student’s t-distribution which may be a better approximation of financial
data. The algorithm uses a two state hidden Markov model to estimate the current
state (also known as regime) of the market, bull or bear. Based on the estimation,
predictions of future returns are made. The algorithm will then use this information
to trade a risky asset, in this case the S&P 500 stock index. A portion of the available
capital will be placed in the asset and the rest will be held in cash at the risk free
rate. The portion of the available capital the algorithm is to invest in the risky asset
is decided using model predictive control. Using model predictive control one is able
to maximize the return for the entire portfolio over a future time horizon. In the
maximization one is as well able to include transaction costs and a general aversion
against both risk and trading.
The algorithm is able to obtain a greater return at a lower risk than just investing
in a static portfolio of the stock index. This will yield a greater Sharpe ratio than
the stock index. The resulting algorithm works the best if the portfolio is long-only,
i.e. if the algorithm is not allowed to go short in the traded asset. Even though the
long-short portfolio is able to yield a higher return to the investor, it will contain more
risk and therefore have a lower Sharpe ratio. The final recommendation will therefore
be for the investor to use the algorithm with a long-only portfolio restriction.
The algorithm allows the use of Bayesian optimization for obtaining optimal model
hyperparameters, for instance the risk- or trading aversion, to maximize performance
on the in-sample data set. The usage will however lead to a huge risk of over-fitting
the model to the in-sample data set and the desired properties are most probably
lost going out-of-sample. The hyperparameters should therefore be chosen manually
with great care and thorough testing. Changing one hyperparameter may also lead to
undesired effects as the many of the hyperparameters are mutually dependent making
in-sample training more difficult. (Less)
Popular Abstract (Swedish)
En aktiekurva är känd för att ha sina upp- och
nedgångar, så kallade bull- och bearmarknader.
I denna uppsats har en matematisk modell
utvecklats för att genom historiska priser kunna
förutsäga om marknaden i framtiden kommer
gå upp eller ned.
Att förutspå om börsen kommer att gå upp eller ned
kan enligt vissa definieras som finansmarknadens
heliga graal. För analytiker och förvaltare är
arbetsuppgiften att försöka svara på frågan,
”upp eller ned?”, alltid aktuell. Ofta besvaras
frågan med hjälp av analytikers kvalitativa
erfarenheter och kunskaper inom ekonomi, men
det är självklart också vanligt att försöka göra
detta med hjälp av kvantitativa och matematiska
modeller. På detta sätt hoppas man alltså att få
en mer... (More)
En aktiekurva är känd för att ha sina upp- och
nedgångar, så kallade bull- och bearmarknader.
I denna uppsats har en matematisk modell
utvecklats för att genom historiska priser kunna
förutsäga om marknaden i framtiden kommer
gå upp eller ned.
Att förutspå om börsen kommer att gå upp eller ned
kan enligt vissa definieras som finansmarknadens
heliga graal. För analytiker och förvaltare är
arbetsuppgiften att försöka svara på frågan,
”upp eller ned?”, alltid aktuell. Ofta besvaras
frågan med hjälp av analytikers kvalitativa
erfarenheter och kunskaper inom ekonomi, men
det är självklart också vanligt att försöka göra
detta med hjälp av kvantitativa och matematiska
modeller. På detta sätt hoppas man alltså att få
en mer objektiv bedömning på hur framsikten ser ut.
Modellen som utvecklats har möjligheten att placera
kapital i aktieindexet S&P 500, ett av världens
mest handlade värdepapper, och på ett bankkonto.
Algoritmen får därför inte låna pengar för att
investera i aktieindex, så kallad hävstång. Den får
heller inte sälja index utan att först äga tillgången,
så kallad blankning. I teorin skulle S&P 500 kunna
bytas ut mot vilket valfritt värdepapper som helst.
Genom att hela tiden bedöma vilket tillstånd
marknaden befinner sig i, bull eller bear, kan
algoritmen dagligen bestämma hur mycket av
pengarna som ska vara investerade i S&P 500.
Detta för att uppnå en högre avkastning till en
lägre risk än om allt kapital hade varit investerat i
S&P 500 hela tiden. Marknadens tillstånd är dock
inte något som är direkt observerbart utan räknas
ut genom att endast titta på historiska prisrörelser
med avancerade matematiska modeller.
När marknadens tillstånd bedömts kan dessa
användas för att göra förutsägelser kring kommande
kursrörelser. Man kan alltså inte bara bedöma om
marknaden skall gå upp eller ned utan även med
hur mycket. I samband med att kursrörelserna
bedöms görs även en bedömning av hur stor risk,
eller osäkerhet, som en investering skulle innebära.
All denna info kan sedan användas för att besluta
om vilken typ av investering som ska göras. I denna
uppsats har endast hänsyn tagits för att erhålla en
så stor vinst som möjligt, men det kan även tänkas
att andra faktorer påverkar en investerares beslut.
Resultatet av algoritmens handel jämfört med ak-
tieindex mellan åren 1996-2017 kan ses i figuren.
Som man kan se klarar algoritmen att förutspå båda
börskrascherna 2000 och 2008. Genom att sälja
index och istället placera kapital på ett bankkonto,
som inte rör sig i värde, kan man undvika den förlust
som nedgången hade inneburit. Efter kraschen in-
vesteras sedan pengarna i S&P 500 för att återigen
åtnjuta börsens uppgång. (Less)
Please use this url to cite or link to this publication:
author
Eliasson, Emil and Hamlin, Linus
supervisor
organization
course
FMS820 20181
year
type
H2 - Master's Degree (Two Years)
subject
language
English
id
8943279
date added to LUP
2018-05-30 14:20:19
date last changed
2018-05-30 14:20:19
@misc{8943279,
  abstract     = {{The work in this thesis is meant to improve an existing algorithm described in Nystrup
(2017). As the original model uses a normal distribution to approximate the daily
logarithmic returns, the authors of this thesis aim to improve the approximation
by using Student’s t-distribution which may be a better approximation of financial
data. The algorithm uses a two state hidden Markov model to estimate the current
state (also known as regime) of the market, bull or bear. Based on the estimation,
predictions of future returns are made. The algorithm will then use this information
to trade a risky asset, in this case the S&P 500 stock index. A portion of the available
capital will be placed in the asset and the rest will be held in cash at the risk free
rate. The portion of the available capital the algorithm is to invest in the risky asset
is decided using model predictive control. Using model predictive control one is able
to maximize the return for the entire portfolio over a future time horizon. In the
maximization one is as well able to include transaction costs and a general aversion
against both risk and trading.
The algorithm is able to obtain a greater return at a lower risk than just investing
in a static portfolio of the stock index. This will yield a greater Sharpe ratio than
the stock index. The resulting algorithm works the best if the portfolio is long-only,
i.e. if the algorithm is not allowed to go short in the traded asset. Even though the
long-short portfolio is able to yield a higher return to the investor, it will contain more
risk and therefore have a lower Sharpe ratio. The final recommendation will therefore
be for the investor to use the algorithm with a long-only portfolio restriction.
The algorithm allows the use of Bayesian optimization for obtaining optimal model
hyperparameters, for instance the risk- or trading aversion, to maximize performance
on the in-sample data set. The usage will however lead to a huge risk of over-fitting
the model to the in-sample data set and the desired properties are most probably
lost going out-of-sample. The hyperparameters should therefore be chosen manually
with great care and thorough testing. Changing one hyperparameter may also lead to
undesired effects as the many of the hyperparameters are mutually dependent making
in-sample training more difficult.}},
  author       = {{Eliasson, Emil and Hamlin, Linus}},
  language     = {{eng}},
  note         = {{Student Paper}},
  title        = {{Outlier-Robust Dynamic Portfolio Optimization based on Bear-Bull-Regimes}},
  year         = {{2018}},
}