Skip to main content

LUP Student Papers

LUND UNIVERSITY LIBRARIES

Portfolio Optimization with Machine Learning: Predicting Market Returns and Portfolio Weights

Ibek, Paulina LU and Graf Brolund, Åke (2025) In Master's Thesis in Mathematical Sciences MASM02 20251
Mathematical Statistics
Abstract
Portfolio optimization is a central problem in finance, with traditional approaches of-
ten relying on forecasts of expected returns and covariances. With the growing adoption
of machine learning in finance, return forecasting using ML techniques has become in-
creasingly common. More recently, an alternative approach has been proposed where the
portfolio weights are learned directly, bypassing the need to predict returns explicitly. De-
spite growing interest, there exists limited empirical work comparing these two methods,
using different models and hyperparameter settings.
This thesis investigates and compares two machine learning-based approaches to port-
folio optimization for futures contracts: a benchmark method that... (More)
Portfolio optimization is a central problem in finance, with traditional approaches of-
ten relying on forecasts of expected returns and covariances. With the growing adoption
of machine learning in finance, return forecasting using ML techniques has become in-
creasingly common. More recently, an alternative approach has been proposed where the
portfolio weights are learned directly, bypassing the need to predict returns explicitly. De-
spite growing interest, there exists limited empirical work comparing these two methods,
using different models and hyperparameter settings.
This thesis investigates and compares two machine learning-based approaches to port-
folio optimization for futures contracts: a benchmark method that predicts future market
returns, and a direct method that estimates portfolio weights without explicit return
forecasts. Both methods are implemented using linear regression, multilayer perceptrons
(MLPs), and extreme gradient boosting (XGBoost), with systematic hyperparameter
tuning. The models are evaluated on both in-sample and out-of-sample periods, using
risk-adjusted performance metrics such as Sharpe ratio, NCVaR, and maximum draw-
down.
The results show that short return windows and moderate regularization improve
generalization, and that simpler model architectures often yield better out-of-sample per-
formance. Neither the benchmark nor the direct method was a clear winner in terms
of cumulative risk-adjusted returns; the performances heavily depend on the machine
learning model used, as well as the hyperparameters. One of the best results in terms
of Sharpe, was achieved by combining predictions from both the benchmark and direct
method with several machine learning models. This illustrates the value of ensemble ap-
proaches in financial modeling and suggests that rather than competing, return-based and
direct methods can complement each other to improve real-world portfolio performance. (Less)
Popular Abstract (Swedish)
Att investera sina pengar på ett smart sätt – så kallad portföljoptimering – är en grundläg-
gande utmaning inom finans. Traditionellt har detta byggt på att man försöker förutspå
framtida avkastning och hur olika tillgångar samvarierar. Men dessa uppskattningar är
ofta osäkra och kan leda till felbeslut. I takt med att maskininlärning blivit allt vanligare
inom finansvärlden har nya metoder utvecklats för att förbättra sådana förutsägelser. En
nyare idé är att helt hoppa över steget med att förutspå avkastning, och istället låta
algoritmen direkt lära sig hur kapitalet bör fördelas mellan olika tillgångar.
I detta examensarbete jämförs två maskininlärningsbaserade metoder för att optimera
portföljer bestående av terminskontrakt:... (More)
Att investera sina pengar på ett smart sätt – så kallad portföljoptimering – är en grundläg-
gande utmaning inom finans. Traditionellt har detta byggt på att man försöker förutspå
framtida avkastning och hur olika tillgångar samvarierar. Men dessa uppskattningar är
ofta osäkra och kan leda till felbeslut. I takt med att maskininlärning blivit allt vanligare
inom finansvärlden har nya metoder utvecklats för att förbättra sådana förutsägelser. En
nyare idé är att helt hoppa över steget med att förutspå avkastning, och istället låta
algoritmen direkt lära sig hur kapitalet bör fördelas mellan olika tillgångar.
I detta examensarbete jämförs två maskininlärningsbaserade metoder för att optimera
portföljer bestående av terminskontrakt: en traditionell metod som försöker förutsäga
framtida marknadsavkastning, och en direkt metod som lär sig portföljvikterna utan
att först räkna ut avkastningen. Båda metoderna har testats med tre olika maskinin-
lärningsmodeller – linjär regression, artificiella neurala nätverk (MLP) och en avancerad
form av beslutsträd kallad XGBoost – där parametrarna har justerats för bästa möjliga
resultat. Modellerna har utvärderats på historiska data och på ny, osedd data. Fokus har
legat på riskjusterade mått såsom Sharpe-kvot, max nedgång och hur långa eller korta
portföljerna är.
Resultaten visar bland annat att det är bättre att estimera avkastningen för kort-
are tidsperioder. En viktig slutsats är att enklare modeller ofta fungerar bättre än mer
avancerade, vilket är typiskt för finansiell data som är svår att förutsäga. Arbetet visar att
varken den direkta eller traditionella metoden konsekvent fungerar bättre, utan det är helt
beroende på maskininlärningsmodellen den kombineras med och vilka hyperparametrar
som används. Däremot är det tydligt att genom att kombinera flera olika modeller kan
man skapa mer robusta portföljer. Istället för att se de två angreppssätten som konkur-
rerande, föreslås att de kan användas tillsammans för att förbättra portföljens verkliga
prestanda. (Less)
Please use this url to cite or link to this publication:
author
Ibek, Paulina LU and Graf Brolund, Åke
supervisor
organization
alternative title
Portföljoptimering med maskininlärning: Prediktion av marknadsavkastning och portföljvikter
course
MASM02 20251
year
type
H2 - Master's Degree (Two Years)
subject
keywords
Portfolio optimization, futures contracts, machine learning, return forecasting, portfolio weights
publication/series
Master's Thesis in Mathematical Sciences
report number
LUTFMS-3134-2025
ISSN
1404-6342
other publication id
2025:E84
language
English
id
9205798
date added to LUP
2025-06-26 08:13:57
date last changed
2025-06-26 08:13:57
@misc{9205798,
  abstract     = {{Portfolio optimization is a central problem in finance, with traditional approaches of-
ten relying on forecasts of expected returns and covariances. With the growing adoption
of machine learning in finance, return forecasting using ML techniques has become in-
creasingly common. More recently, an alternative approach has been proposed where the
portfolio weights are learned directly, bypassing the need to predict returns explicitly. De-
spite growing interest, there exists limited empirical work comparing these two methods,
using different models and hyperparameter settings.
This thesis investigates and compares two machine learning-based approaches to port-
folio optimization for futures contracts: a benchmark method that predicts future market
returns, and a direct method that estimates portfolio weights without explicit return
forecasts. Both methods are implemented using linear regression, multilayer perceptrons
(MLPs), and extreme gradient boosting (XGBoost), with systematic hyperparameter
tuning. The models are evaluated on both in-sample and out-of-sample periods, using
risk-adjusted performance metrics such as Sharpe ratio, NCVaR, and maximum draw-
down.
The results show that short return windows and moderate regularization improve
generalization, and that simpler model architectures often yield better out-of-sample per-
formance. Neither the benchmark nor the direct method was a clear winner in terms
of cumulative risk-adjusted returns; the performances heavily depend on the machine
learning model used, as well as the hyperparameters. One of the best results in terms
of Sharpe, was achieved by combining predictions from both the benchmark and direct
method with several machine learning models. This illustrates the value of ensemble ap-
proaches in financial modeling and suggests that rather than competing, return-based and
direct methods can complement each other to improve real-world portfolio performance.}},
  author       = {{Ibek, Paulina and Graf Brolund, Åke}},
  issn         = {{1404-6342}},
  language     = {{eng}},
  note         = {{Student Paper}},
  series       = {{Master's Thesis in Mathematical Sciences}},
  title        = {{Portfolio Optimization with Machine Learning: Predicting Market Returns and Portfolio Weights}},
  year         = {{2025}},
}