Detecting Portfolio Risk Beyond Traditional Metrics

Traditional portfolio risk measures—Value at Risk, Sharpe ratio, and beta—are designed to quantify known risks based on historical patterns. While these tools remain essential, they are not built to answer a different and increasingly important question:

Is there something unusual about a portfolio’s behavior that may indicate elevated or emerging risk?

This article introduces a machine-learning–based approach to portfolio anomaly detection that complements traditional risk metrics rather than replacing them.


Why Anomaly Detection?

Markets evolve. Correlations shift, volatility regimes change, and portfolio structures that once appeared stable can begin to behave in unexpected ways. These changes often manifest first as structural inconsistencies rather than outright losses:

  • Momentum and volatility indicators sending conflicting signals
  • Portfolios whose diversification breaks down under stress
  • Concentration risk that is not obvious until market conditions shift

Anomaly detection focuses on identifying these unusual patterns before they fully materialize as realized risk.


A Dual-Model Machine Learning Approach

The system described in the accompanying whitepaper uses a dual-model ensemble:

  • An Autoencoder neural network learns normal market behavior by compressing and reconstructing correlated technical indicators. When familiar patterns break down, reconstruction error increases.
  • An Isolation Forest independently identifies observations that are structurally rare relative to the broader market.

By combining these models, the system detects both subtle pattern shifts and sharp statistical outliers. The models are trained on a broad market universe, allowing immediate evaluation of new portfolios without requiring portfolio-specific historical data.


Market-Relative Risk Context

Raw anomaly scores alone can be misleading during periods of market-wide stress. To address this, portfolio anomaly scores are normalized against the current market distribution using z-scores. This provides a market-relative perspective, answering not just “Is this portfolio unusual?” but “Is it more unusual than the market as a whole right now?”


Who This Is For

This work is intended for:

  • Investment professionals interested in complementary risk signals
  • Engineers and data scientists exploring applied anomaly detection
  • Organizations evaluating ML-driven approaches to risk assessment

It is not a trading system, nor a replacement for established financial risk metrics. Instead, it serves as an early-warning and investigative tool.


Read the Full Whitepaper

The full technical whitepaper covers:

  • System architecture and data pipeline
  • Feature engineering and portfolio aggregation strategy
  • Model validation using realistic anomaly scenarios
  • Market-relative scoring and risk classification logic

👉 Download the Whitepaper (PDF)

The complete implementation is available as an open-source project on GitHub at timpinard/portfolio-anomaly-detection.


Tim Pinard is a software engineer focused on applying machine learning to financial and risk analysis problems.