Monte Carlo Normal
Estimate portfolio risk by simulating correlated asset returns using a multivariate normal model.
Overview
The Monte Carlo Normal method estimates portfolio risk by generating multiple possible return scenarios for the assets in a portfolio.
The API calculates historical returns from the provided price data, estimates the mean return and covariance structure of the assets, and uses these values to generate correlated simulated returns.
Each simulation produces a possible portfolio outcome over the selected time horizon. 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
Monte Carlo Normal uses historical price data from the selected dataset.
For a multi-asset portfolio, the dataset contains price observations for each asset included in the simulation. The API calculates a return series for each asset and uses the resulting observations to estimate the statistical inputs required for the simulation.
Calculate Historical Returns
The API converts historical prices into simple returns before estimating the simulation parameters.
Where:
- is the return for the current observation.
- is the current price.
- is the price from the previous observation.
The API calculates a return series for each asset in the dataset. These return series are used in the following parameter estimation and simulation steps.
Estimate Mean and Covariance
For each asset, the API calculates the mean of the historical return series.
The API also calculates a covariance matrix across the assets in the dataset.
For two assets A and B, covariance is calculated from the deviations of their historical returns from their respective mean returns.
The resulting covariance matrix is used to model the relationship between simulated returns across multiple assets.
Cholesky Decomposition
For portfolios containing multiple assets, the API uses the covariance matrix to model the relationship between asset returns.
The covariance matrix is decomposed using Cholesky decomposition before generating correlated random shocks for the simulation.
- is the covariance matrix of asset returns.
- is a lower triangular matrix.
- is the transpose of .
The resulting matrix is used in the next step to transform independent random variables into correlated shocks that follow the covariance structure estimated from the input data.
Generate Standard Normal Variables
The API generates independent random variables from a standard normal distribution for each simulation, time step, and asset.
- represents a vector of independent standard normal random variables.
- represents a multivariate normal distribution with zero mean and identity covariance matrix.
For a portfolio containing multiple assets, the API generates independent random values for every asset at each simulated time step.
The generated values are then transformed using the Cholesky factor from the covariance matrix to introduce the correlation structure between asset returns.
Calculate Simulated Returns
The API calculates simulated returns by combining the estimated mean return of each asset with the correlated random shocks generated during the simulation.
- represents the simulated return.
- represents the estimated mean return of an asset.
- represents the correlated random shock.
A simulated return is generated for each asset at every simulated time step across all requested simulation scenarios.
Simulate Asset Value Paths
The API applies the simulated returns to the initial value of each asset position to generate simulated value paths across the requested time horizon.
- represents the simulated value of asset position at time step .
- represents the value of the asset position at the previous time step.
- represents the simulated return of asset for the current time step.
The calculation is applied sequentially across the requested time horizon, producing a simulated value path for each asset position in every simulation scenario.
Equivalently, the value at each time step can be expressed as the cumulative product of the simulated growth factors.
For the first simulated time step, the calculation starts from the initial value of each asset position provided in the portfolio input.
Calculate Portfolio Value
For each simulation scenario, the API calculates the total portfolio value by summing the simulated values of all asset positions.
- represents the total portfolio value at time step .
- represents the simulated value of asset position at time step .
- represents the number of asset positions in the portfolio.
The calculation is performed for every simulation scenario across the requested time horizon.
The terminal portfolio value is the total portfolio value at the final simulated time step.
Calculate Profit and Loss
After calculating the terminal portfolio value for each simulation scenario, the API calculates the corresponding profit or loss relative to the initial portfolio value.
- represents the profit or loss for a simulation scenario.
- represents the portfolio value at the final simulated time step.
- represents the initial portfolio value.
A positive P&L represents a simulated gain, while a negative P&L represents a simulated loss.
The resulting P&L values from all simulation scenarios form the distribution used to calculate Value at Risk and Conditional Value at Risk.
Calculate Value at Risk
The API calculates Value at Risk from the simulated portfolio profit and loss distribution at the requested confidence level.
P&L Quantile
First, the API identifies the lower-tail quantile of the simulated P&L distribution.
- 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 simulated 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 simulated time horizon.
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 simulated 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 simulated P&L outcomes that fall at or below the lower-tail P&L quantile.
These outcomes represent the simulated scenarios in the selected lower tail of the P&L distribution.
Average Tail P&L
The API calculates the average P&L across all outcomes in the selected tail.
- represents the average P&L of the selected tail outcomes.
- represents the number of simulated outcomes in the tail.
- represents an individual simulated P&L outcome.
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 simulated outcomes in the selected lower tail of the P&L distribution.
Method Summary
Monte Carlo Normal in the Quant Risk API follows these steps:
- Convert historical prices into simple returns.
- Estimate mean returns and the covariance matrix.
- Apply Cholesky decomposition to the covariance matrix.
- Generate independent standard normal variables.
- Transform the variables into correlated shocks.
- Generate simulated returns and asset value paths.
- Calculate portfolio profit and loss for each simulation.
- Calculate VaR and CVaR from the resulting P&L distribution.