Value at Risk simulation sample: Overview

The Value at Risk (VaR) simulation sample demonstrates a common use case in financial risk analysis to show how IBM® Spectrum Symphony can maximize performance of big-data analytic applications. With this sample, IBM Spectrum Symphony uses a Monte Carlo simulation to calculate the value at risk for an investment portfolio.

Value at Risk - or VaR - measures the risk of loss for investments in a time period and helps predict the maximum expected loss for an entire portfolio. When VaR is calculated by running a Monte Carlo simulation, a large set of random numbers is generated for different possible market scenarios and the portfolio's value is calculated for each scenario.

While the Monte Carlo simulation is widely used in financial risk analysis because of its flexibility, it needs significant computational resources to generate the required number of results. Here's where IBM Spectrum Symphony can make a difference. With enterprise resource-utilization capabilities, IBM Spectrum Symphony divides a computation into several tasks that run in parallel to deliver faster results.

How it works

The Value at Risk (VaR) simulation in IBM Spectrum Symphony implements a two-level parent-child session model. The parent session creates a child session whose tasks perform the actual computation. The parent session collects the results of the child tasks and aggregates them to calculate the final VaR.

The following figure shows at a high level how IBM Spectrum Symphony submits workload for a three-equity investment portfolio and calculates VaR:

High-level image, showing simulation workload submitted from an IBM Spectrum Symphony client, processed, and results being retrieved
  1. When the VaR calculation is triggered, the IBM Spectrum Symphony client submits sample workload to the cluster. The client creates a parent session and sends configuration parameters along with details of the three equities (such as price, expected return, and volatility) as task input.
  2. The parent session creates a parent task, which in turn creates a child session that spawns 60 child tasks.
  3. Each child task runs 10K simulations and computes VaR as follows:
    1. Determines the time horizon, which is a user-defined period for the VaR simulation, and divides it into small equal time periods. This example uses a time horizon of 22 days.
    2. Generates a random price path for the investment and updates its price at the end of the first time period. This data is saved in memory and used for all further calculations.
    3. Repeats step 3.b until it reaches the end of the time horizon (22 days).
    4. Repeats steps 3.b and 3.c x times, where x is the user-defined number of simulation steps (iterations), to generate a large volume of different price paths. In this example, 20 iterations of 10K simulations for three equities translate to 600,000 simulations.
    5. Returns the result to the parent session.
  4. The parent session collects the results of each child task, aggregates the results to get the final VaR for each equity, and returns the value to the client.