1. Introduction
The rising availability of large cross-sectional datasets and powerful machine-learning models has transformed equity return forecasting. Gradient-boosting methods, notably LightGBM, effectively capture intricate non-linear relationships among firm-specific characteristics, market-based features, and macroeconomic indicators, frequently outperforming traditional linear factor models in forecasting accuracy [1, 2]. However, translating these forecasts into actionable portfolio weights typically relies on ad-hoc heuristics—ranking by scores, fixed sector-neutral tilts, or simple volatility scaling— that neglect execution costs and position limits, leading to suboptimal net returns and uncontrolled turnover [3].
In contrast, the mean-variance framework provides a principled approach to balance expected return against risk, and extensions incorporating quadratic transaction costs offer closed-form feedback policies [4, 5]. Yet practical adoption has been hindered by computational complexity: naively solving a quadratic program at each rebalance can be prohibitive for large universes or high-frequency needs [6].
This paper presents an integrated pipeline that directly embeds LightGBM return predictions into a convex mean–variance allocator with explicit
2. Model and data
2.1. Optimization framework
This research denotes the number of assets by
The target is to choose the next-period weights
Here,
2.2. Analytic update-and-project
Assuming a diagonal covariance matrix, construct a diagonal pre-conditioner by combining the risk-aversion coefficient with that covariance and a small ridge adjustment. With the individual box constraints temporarily set aside, the first-order optimality conditions reduce to the following single affine weight update:
Where the scalar η is chosen so that absolute weights sum exactly to one.
If every tentative position generated by (3) remains below the cap C in absolute value, expression (3) is the unique solution of the original quadratic-programme formulation.
If any component of
The resulting routine replaces generic quadratic-programming solvers with a transparent, closed-form update whose complexity scales linearly with portfolio size apart from the sortable projection. By decoupling the analytical update from the lightweight projection, the method retains full interpretability, guarantees exact budget satisfaction, and accommodates explicit turnover penalties and position caps without iterative optimisation.
2.3. Projection with caps
When the raw update
The projection follows a clip-and-rebalance routine. Clip any provisional magnitudes that exceed the cap by setting
After clipping, the magnitudes may still sum to more than one, so compute:
If S=1, the projection is complete. When S>1, let R be the sum of magnitudes for the assets that were not capped. Reduce each of those magnitudes proportionally:
After this adjustment the magnitudes sum to one and none exceeds the cap CCC. Restore the original signs to obtain the final portfolio weights:
2.4. Worked example
Assume the raw absolute weights for four stocks are 0.50, 0.30, 0.25 and 0.10, while the per-stock cap is 0.40.
(1) Clip. Only the first name is above the cap, so it is trimmed from 0.50 to 0.40. The provisional magnitudes become 0.40, 0.30, 0.25, 0.10, whose total is 1.05.
(2) Rebalance. Because the sum exceeds one by 0.05, the surplus is removed from the three unclipped names in proportion to their sizes. The reduction factors are their own magnitudes divided by the unclipped total 0.65. After the adjustment, the magnitudes are 0.40, 0.277, 0.231, 0.092, which add exactly to one and all respect the cap.
(3) Restore signs. Multiply each final magnitude by the sign of its original raw weight to obtain the signed portfolio.
This two-step, sorting-free clip-and-rebalance routine preserves the sum of weights equal to 1 and the capped at C using only O(n) arithmetic once the assets have been scanned.
2.5. Feature engineering
A pro data-cleaning and pre-processing step is undertaken to ensure robust feature construction and accurate modelling, during which the full S&P 500 universe is screened for stocks lacking sufficient price history between 2010 and 2025 [10]. To ensure robust feature construction and accurate modelling, an essential data-cleaning step is performed prior to feature engineering. Specifically, screening the initial universe of S&P 500 constituents for stocks with insufficient historical coverage over the evaluation period (2010–2025).
Stocks are retained in the final sample only if their available adjusted closing price data covers at least 95% of all trading days within the considered period. After applying this screening procedure, the final dataset retains a stable and representative cross-section of approximately 300 high-quality stocks, ensuring reliable factor estimation and mitigating biases arising from missing data or sample-selection variations. The cleaned price dataset thus obtained serves as the foundational input for all subsequent predictive modelling and optimization procedures described in the following sections.
A construction including seven interpretable predictors for each stock
Momentum:
Realized Volatility:
MA Ratio:
Max Drawdown:
Amihud Illiquidity (5):
Price-to-Book: Forward-filled quarterly
Return on Equity: Forward-filled quarterly ROE ratio [15].
All predictors are cross-sectionally standardized via rank transforms before embedding into LightGBM regression to produce forecasts
3. Experimental setup and results
3.1. Back-test design
The study’s back-test uses daily CRSP total-return data for S&P 500 constituents from January 2010 to January 2025, focusing on the evaluation window of January 2020-January 2025 [14]. Before performing feature engineering and model training, standard data-cleaning procedures was implemented, including screening for minimum historical data availability (≥95%) and ensuring consistent date indexing across all assets. This step significantly reduces biases arising from incomplete or sparse data. The LightGBM model is retrained monthly using an expanding rolling-window approach to ensure that forecasts adapt dynamically to evolving market regimes.
The research selects the key parameters in the mean-variance optimization—risk aversion
This research verified the robustness of these parameter choices through sensitivity checks, confirming stable performance across plausible parameter ranges.
3.2. Performance versus the S&P 500 total return
Over the 2020-2025 back-test period, the MV-Turnover allocator not only outstrips the S&P 500 TR on raw returns but does so while materially improving riskadjusted metrics and drawdowns. The strategy delivers a compelling annualized return of 17.8%, representing a substantial 63% increase over the benchmark's 10.9%. Remarkably, portfolio volatility remains nearly unchanged (17.3% versus 18.1% for the benchmark), translating into a gross Sharpe ratio of 1.03, surpassing the benchmark by over 70 basis points (0.60), thereby achieving a 43% relative improvement compared to passive indexing.
Examining the drawdown profile, the strategy limits peak-to-trough losses to
Although the study’s approach incurs significantly higher turnover than a passive buy-and-hold strategy (94% versus 5%), the associated transaction costs and market impact are more than compensated by improved market-timing ability and disciplined risk management, especially evident during periods of elevated volatility and rapid regime shifts. In particular, it is observed that the highest-turnover months coincide with periods of elevated cross-sectional dispersion and rapid regime shifts—exactly when naive long-only mandates suffer the worst drawdowns. Taken together, these results underscore the practical value of a fully analytic, cost-aware portfolio update: By formalizing turnover in the objective function and enforcing per-asset caps, the approach harnesses LightGBM's nonlinear forecasts while avoiding excessive trading and risk concentration. Table 1 reports performance measures against the S&P 500 TR.
Strategy |
Ann. Ret |
Vol |
Sharpe |
Max DD |
Turnover |
MV-Turnover |
17.8% |
17.3% |
1.03 |
-21.0% |
94% |
S&P 500 TR |
10.9% |
18.1% |
0.60 |
-33.1% |
5% |
4. Discussion and future work
The analytic update-and-project allocator combines three design choices that jointly explain the empirical out-performance. First, the ℓ₂ turnover term tempers rapid reshuffling, thereby preserving more of the alpha embedded in LightGBM forecasts once realistic costs are deducted; sensitivity tests confirm that reducing this penalty by half raises gross return but erodes net Sharpe as commissions accumulate. Second, per-asset caps distribute risk more evenly across the cross-section, preventing idiosyncratic blow-ups that dominated benchmark drawdowns in both the COVID-19 crash and the 2022–2023 tightening cycle. Third, the diagonal-covariance assumption accelerates rebalancing, enabling monthly retraining and re-optimisation without latency, so signals remain aligned with fast-moving valuations and macro news.
Looking ahead, several considerations may enhance robustness in future market regimes. If inflation surprises keep real yields elevated, dispersion among value-sensitive sectors (e.g., financials and energy) is likely to widen. Under that scenario, raising the cap C modestly—for example, from 3% to 4%—could allow larger conviction tilts while still avoiding excessive concentration. Conversely, in environments featuring compressed volatility and crowded momentum trades, the turnover penalty λ should be tightened to dampen over-reaction to transient price moves. Robustness checks indicate an empirical relation in which the optimal λ can be scaled linearly with the trailing 30-day realized volatility, particularly considering VIX levels; measures of realized volatility are discussed in prior literature [17]. Finally, should market microstructure continue to fragment across lit and dark venues, incorporating an intraday spread estimator would refine cost calibration and preserve the strategy’s edge when high-frequency liquidity thins [18].
In sum, the documented results stem from a deliberate trade-off between signal exploitation and cost control, while the suggested parameter adjustments offer a roadmap for maintaining performance as macro conditions and market microstructure evolve.
5. Conclusion
This study demonstrates that short-horizon LightGBM return forecasts can be embedded directly within a convex mean-variance allocator to create a fast, interpretable, and high-performing equity strategy. The diagonal-covariance assumption enables a closed-form update-and-project routine whose complexity scales as O(n
Several limitations point to promising directions for further work. First, the diagonal-risk assumption ignores cross-asset covariance; replacing it with low-rank factor structures or regime-aware volatility models could capture richer risk propagation at modest computational cost. Second, although the turnover penalty mitigates trading, annual turnover remains high compared with passive indexing; adaptive cost learning—potentially via reinforcement-learning techniques—may refine the balance between signal exploitation and transaction frictions. Third, the analysis is confined to large-capitalisation U.S. equities; extending the framework to multi-asset portfolios, emerging markets, or intraday high-frequency horizons would test its scalability and uncover market-specific nuances. Finally, integrating real-time liquidity metrics and venue-level spread estimates could improve cost calibration as market microstructure continues to evolve. Addressing these issues will broaden the allocator’s applicability and further strengthen its practical value for asset-management practice.
References
[1]. Gu, S., Kelly, B., & Xiu, D. (2020). Empirical asset pricing via machine learning. Review of Financial Studies, 33(5), 2223–2273.
[2]. Ke, G., Meng, Q., Finley, T., Wang, T., Chen, W., Ma, W., Ye, Q., & Liu, T.-Y. (2017). LightGBM: A highly efficient gradient boosting decision tree. In I. Guyon et al. (Eds.), Advances in Neural Information Processing Systems, 30, 3146–3154.
[3]. Lobo, M. S., Fazel, M., Boyd, S., & Shen, Z. (2007). Portfolio optimization with linear and fixed transaction costs. Annals of Operations Research, 152, 341–365.
[4]. Gârleanu, N., & Pedersen, L. H. (2013). Dynamic trading with predictable returns and transaction costs. The Journal of Finance, 68(6), 2309–2340.
[5]. Markowitz, H. M. (1952). Portfolio selection. The Journal of Finance, 7(1), 77–91.
[6]. Boyd, S., & Vandenberghe, L. (2004). Convex optimization. Cambridge University Press.
[7]. Andersen, T. G., Bollerslev, T., Diebold, F. X., & Labys, P. (2003). Modeling and forecasting realized volatility. Econometrica, 71(2), 579–625.
[8]. Barlow, R. E., Bartholomew, D. J., Bremner, J. M., & Brunk, H. D. (1972). Statistical inference under order restrictions: The theory and application of isotonic regression. Wiley.
[9]. Duchi, J., Shalev-Shwartz, S., Singer, Y., & Chandra, T. (2008). Efficient projections onto the ℓ₁-ball for learning in high dimensions. In Proceedings of the 25th International Conference on Machine Learning, 272–279.
[10]. S& P Global. (2021). S& P 500® fact sheet. Retrieved from https: //www.spglobal.com/spdji/en/.
[11]. Jegadeesh, N., & Titman, S. (1993). Returns to buying winners and selling losers: Implications for stock-market efficiency. The Journal of Finance, 48(1), 65–91.
[12]. Amihud, Y. (2002). Illiquidity and stock returns: Cross-section and time-series effects. Journal of Financial Markets, 5(1), 31–56.
[13]. Fama, E. F., & French, K. R. (1993). Common risk factors in the returns on stocks and bonds. Journal of Financial Economics, 33(1), 3–56.
[14]. Center for Research in Security Prices. (2024). CRSP US stock database guide. University of Chicago Booth School of Business.
[15]. Hou, K., Xue, C., & Zhang, L. (2020). Replicating anomalies. Review of Financial Studies, 33(5), 2019–2133.
[16]. López de Prado, M. L. (2018). Advances in financial machine learning. Wiley.
[17]. Bali, T. G., & Çakici, N. (2003). Idiosyncratic volatility and the cross-section of expected returns. Journal of Financial and Quantitative Analysis, 38(2), 241–273.
[18]. O’Hara, M., & Ye, M. (2011). Is market fragmentation harming market quality? Journal of Financial Economics, 100(3), 459–474.
Cite this article
Li,J. (2025). Convex-Analytic Mean-Variance Allocation with LightGBM Forecasts. Advances in Economics, Management and Political Sciences,200,62-68.
Data availability
The datasets used and/or analyzed during the current study will be available from the authors upon reasonable request.
Disclaimer/Publisher's Note
The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of EWA Publishing and/or the editor(s). EWA Publishing and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
About volume
Volume title: Proceedings of ICEMGD 2025 Symposium: Innovating in Management and Economic Development
© 2024 by the author(s). Licensee EWA Publishing, Oxford, UK. This article is an open access article distributed under the terms and
conditions of the Creative Commons Attribution (CC BY) license. Authors who
publish this series agree to the following terms:
1. Authors retain copyright and grant the series right of first publication with the work simultaneously licensed under a Creative Commons
Attribution License that allows others to share the work with an acknowledgment of the work's authorship and initial publication in this
series.
2. Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the series's published
version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial
publication in this series.
3. Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and
during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See
Open access policy for details).
References
[1]. Gu, S., Kelly, B., & Xiu, D. (2020). Empirical asset pricing via machine learning. Review of Financial Studies, 33(5), 2223–2273.
[2]. Ke, G., Meng, Q., Finley, T., Wang, T., Chen, W., Ma, W., Ye, Q., & Liu, T.-Y. (2017). LightGBM: A highly efficient gradient boosting decision tree. In I. Guyon et al. (Eds.), Advances in Neural Information Processing Systems, 30, 3146–3154.
[3]. Lobo, M. S., Fazel, M., Boyd, S., & Shen, Z. (2007). Portfolio optimization with linear and fixed transaction costs. Annals of Operations Research, 152, 341–365.
[4]. Gârleanu, N., & Pedersen, L. H. (2013). Dynamic trading with predictable returns and transaction costs. The Journal of Finance, 68(6), 2309–2340.
[5]. Markowitz, H. M. (1952). Portfolio selection. The Journal of Finance, 7(1), 77–91.
[6]. Boyd, S., & Vandenberghe, L. (2004). Convex optimization. Cambridge University Press.
[7]. Andersen, T. G., Bollerslev, T., Diebold, F. X., & Labys, P. (2003). Modeling and forecasting realized volatility. Econometrica, 71(2), 579–625.
[8]. Barlow, R. E., Bartholomew, D. J., Bremner, J. M., & Brunk, H. D. (1972). Statistical inference under order restrictions: The theory and application of isotonic regression. Wiley.
[9]. Duchi, J., Shalev-Shwartz, S., Singer, Y., & Chandra, T. (2008). Efficient projections onto the ℓ₁-ball for learning in high dimensions. In Proceedings of the 25th International Conference on Machine Learning, 272–279.
[10]. S& P Global. (2021). S& P 500® fact sheet. Retrieved from https: //www.spglobal.com/spdji/en/.
[11]. Jegadeesh, N., & Titman, S. (1993). Returns to buying winners and selling losers: Implications for stock-market efficiency. The Journal of Finance, 48(1), 65–91.
[12]. Amihud, Y. (2002). Illiquidity and stock returns: Cross-section and time-series effects. Journal of Financial Markets, 5(1), 31–56.
[13]. Fama, E. F., & French, K. R. (1993). Common risk factors in the returns on stocks and bonds. Journal of Financial Economics, 33(1), 3–56.
[14]. Center for Research in Security Prices. (2024). CRSP US stock database guide. University of Chicago Booth School of Business.
[15]. Hou, K., Xue, C., & Zhang, L. (2020). Replicating anomalies. Review of Financial Studies, 33(5), 2019–2133.
[16]. López de Prado, M. L. (2018). Advances in financial machine learning. Wiley.
[17]. Bali, T. G., & Çakici, N. (2003). Idiosyncratic volatility and the cross-section of expected returns. Journal of Financial and Quantitative Analysis, 38(2), 241–273.
[18]. O’Hara, M., & Ye, M. (2011). Is market fragmentation harming market quality? Journal of Financial Economics, 100(3), 459–474.