The Markowitz portfolio framework is widely used to determine static asset weights, while Merton’s dynamic approach allows allocations to adjust with changing market conditions but is mathematically challenging and less practical. We address this gap by applying machine learning to dynamic portfolio optimization in the spirit of Merton, incorporating economic regimes defined by the VIX volatility index. An artificial neural network is trained to learn optimal allocation policies across regime-switching environments and is compared with classical regime-agnostic and theoretical regime-switching Merton strategies. On synthetic data with realistic constraints prohibiting borrowing and short selling, the machine learning strategy outperforms traditional benchmarks. Two empirical backtests—using monthly data from 1990 to 2025 and annual data from 1928 to 2025—show that accounting for regimes enhances performance and robustness.
