Historical Simulation
Estimate portfolio risk by applying historical market return scenarios to the current portfolio.
Overview
Historical Simulation estimates portfolio risk by replaying observed historical market return paths as possible future scenarios.
For multi-period horizons, the API constructs scenarios using rolling windows of consecutive historical returns.
The API calculates historical returns from the provided price data and constructs historical return paths over the selected time horizon. Each path represents a sequence of market movements that occurred in the historical dataset.
The historical return paths are applied to the current portfolio to generate possible future portfolio outcomes without assuming a specific probability distribution for asset returns.
The API uses all valid rolling historical paths available in the normalized dataset. The resulting distribution of portfolio profit and loss is then used to calculate risk metrics such as Value at Risk (VaR) and Conditional Value at Risk (CVaR).
Input Data
Historical Simulation uses historical price data from the selected dataset to generate future portfolio scenarios.
For a multi-asset portfolio, the dataset contains historical price observations for each asset included in the portfolio. Price observations are aligned by date before returns are calculated so that each multi-asset return observation represents the same historical market period.
The API converts the historical prices into return observations and uses these observations directly as the source of simulated market scenarios.
Unlike parametric Monte Carlo methods, Historical Simulation does not assume that returns follow a specific probability distribution.
Calculate Historical Returns
The API converts historical prices into simple returns before constructing historical simulation scenarios.
Where:
- is the return for the current historical observation.
- is the current historical price.
- is the historical price from the previous observation.
The API calculates a historical return series for each asset in the portfolio dataset.
For a portfolio containing multiple assets, returns from the same historical observation are kept together so that the historical relationship between asset returns is preserved.
These historical return observations are used directly to construct rolling historical scenarios over the requested time horizon.
Construct Historical Scenarios
The API constructs historical simulation scenarios directly from historical return observations instead of generating new random returns from an estimated probability distribution.
Each scenario represents a sequence of consecutive historical asset returns over the requested simulation time horizon.
Rolling Historical Windows
The API constructs scenarios using rolling windows across the historical return series.
For a time horizon of observations, each historical scenario contains consecutive historical return observations. The starting point of each subsequent scenario moves forward by one observation.
- represents historical scenario .
- represents the requested simulation time horizon.
- represents the vector of historical returns for all assets at observation .
Because the windows overlap, consecutive scenarios share historical observations. This allows the API to use every valid consecutive return path available in the historical dataset.
Preserve Multi-Asset Observations
For portfolios containing multiple assets, returns from the same historical observation are kept together when constructing each scenario.
This preserves the historical relationship between asset returns. For example, if multiple assets experienced gains or losses during the same historical observation, those returns remain part of the same historical scenario.
Number of Available Scenarios
The number of available historical scenarios depends on the number of valid historical return observations and the requested time horizon.
- represents the number of valid rolling historical scenarios.
- represents the number of valid historical return observations after data preparation.
- represents the requested simulation time horizon.
A valid historical scenario can be constructed only when the dataset contains at least as many return observations as the requested time horizon.
Use All Available Scenarios
Historical Simulation does not generate new random scenarios. The API applies all valid rolling historical scenarios available in the normalized dataset.
As a result, the number of scenarios is determined automatically by the historical dataset and the requested time horizon.
The parameter used by Monte Carlo methods is not used for Historical Simulation.
The constructed rolling historical scenarios are used in the next step to apply the observed return sequences to the current asset positions and generate simulated asset value paths.
Simulate Asset Value Paths
The API applies the historical return sequence from each scenario to the current value of each asset position to generate a simulated asset value path over the requested time horizon.
Each historical scenario starts from the same current asset position value and applies its sequence of observed historical returns sequentially.
Initial Asset Position Value
All historical scenarios begin from the same current asset position value.
- represents the initial simulated value of asset position for historical scenario .
- represents the current value of asset position .
Apply Historical Returns
For historical scenario , the return applied at simulation time step corresponds to the historical return at index .
The simulated asset value is updated sequentially using the corresponding historical return from the selected scenario.
- represents the simulated value of asset position at simulation time step for historical scenario .
- represents the simulated value of the asset position at the previous time step for the same historical scenario.
- represents the historical return applied to asset at simulation time step in historical scenario .
The calculation is applied sequentially across the requested time horizon, producing one simulated value path for each asset position in every historical scenario.
Cumulative Return Application
Equivalently, the simulated asset value at each time step can be expressed as the cumulative product of the historical return growth factors within the scenario.
- represents the current initial value of asset position .
- represents the current simulation time step within the historical scenario.
- identifies the historical scenario being applied.
Historical Simulation applies observed historical return paths directly to the current portfolio positions. The historical prices themselves are not reused as future prices.
This allows the simulation to evaluate how the current portfolio could change if historical patterns of asset returns were to occur again over the selected time horizon.
Calculate Portfolio Value
For each historical scenario, the API calculates the total portfolio value by summing the simulated values of all asset positions at each time step.
- represents the total portfolio value at time step for historical scenario .
- represents the simulated value of asset position at time step in historical scenario .
- represents the number of asset positions in the portfolio.
The calculation is performed across all time steps in each historical scenario, producing a portfolio value path over the requested time horizon.
Initial Portfolio Value
All historical scenarios begin from the same current portfolio value.
- represents the initial portfolio value for historical scenario .
- represents the current total portfolio value before applying any historical returns.
Terminal Portfolio Value
The terminal portfolio value represents the total portfolio value at the final time step of a historical scenario.
- represents the terminal portfolio value for historical scenario .
- represents the final time step of the requested simulation time horizon.
The terminal portfolio value from each historical scenario is used in the next step to calculate the corresponding portfolio profit and loss.
Calculate Profit and Loss
After calculating the terminal portfolio value for each historical scenario, the API calculates the corresponding profit or loss relative to the initial portfolio value.
- represents the profit or loss for historical scenario .
- represents the total portfolio value at the final time step of historical scenario .
- represents the current total portfolio value before applying the historical scenario.
A positive P&L represents a gain under the corresponding historical scenario, while a negative P&L represents a loss.
The resulting P&L values from all historical scenarios form the historical distribution used to calculate Value at Risk and Conditional Value at Risk.
Because Historical Simulation applies observed historical return paths directly, the resulting P&L distribution reflects the portfolio outcomes associated with the available historical scenarios.
Calculate Value at Risk
The API calculates Value at Risk from the distribution of portfolio profit and loss outcomes generated from the available historical scenarios.
P&L Quantile
First, the API identifies the lower-tail quantile of the portfolio P&L distribution at the requested confidence level.
- represents the lower-tail P&L quantile.
- represents the requested confidence level.
- represents the quantile at probability .
For example, at a 95% confidence level, the API evaluates the 5th percentile of the portfolio P&L distribution.
Value at Risk
The API converts the lower-tail P&L quantile into a non-negative loss value.
The resulting VaR value represents the estimated loss threshold at the requested confidence level over the selected time horizon.
Unlike Monte Carlo methods, Historical Simulation does not estimate a probability distribution to generate new return scenarios. VaR is instead derived directly from the portfolio outcomes produced by the available historical return paths.
The API also returns the underlying P&L quantile so clients can inspect the threshold directly.
Calculate Conditional Value at Risk
Conditional Value at Risk is calculated from portfolio P&L outcomes in the lower tail of the distribution, defined by outcomes at or below the lower-tail P&L quantile used in the VaR calculation.
Tail Outcomes
First, the API identifies historical scenario outcomes with P&L values at or below the lower-tail P&L quantile.
These outcomes represent the historical scenarios contained in the selected lower tail of the portfolio P&L distribution.
Average Tail P&L
The API calculates the average P&L across all historical scenario outcomes in the selected tail.
- represents the average P&L of the selected tail outcomes.
- represents the number of historical scenario outcomes in the tail.
- represents the portfolio profit or loss for historical scenario .
Conditional Value at Risk
The average tail P&L is converted into a non-negative loss value.
The resulting CVaR represents the average loss across historical scenarios in the selected lower tail of the P&L distribution.
Because Historical Simulation uses observed historical return paths directly, CVaR reflects the average severity of the historical portfolio outcomes that fall beyond the selected VaR threshold.
Method Summary
Historical Simulation in the Quant Risk API follows these steps:
- Convert historical prices into simple returns.
- Keep return observations for multiple assets aligned by their historical observation dates.
- Construct all valid rolling historical return paths based on the requested time horizon.
- Apply every available historical return path to the current asset positions to generate simulated asset value paths.
- Calculate the portfolio value across each historical scenario.
- Calculate the terminal portfolio value and corresponding profit and loss for each historical scenario.
- Calculate VaR and CVaR from the resulting portfolio P&L distribution.
Unlike Monte Carlo methods, Historical Simulation does not generate new random return scenarios. Portfolio risk is estimated by applying observed historical return paths directly to the current portfolio positions.