Mirai Risk Metrics (MiRiM) is a Shiny application that aims at reproducing the basic functionality of the RiskMetrics software regarding the Risk Measures calculation for a given portfolio. It was initially developed by Mirai Solutions as a PoC for a commodity trading company interested in replacing a vendor tool with a more flexible and open-source technology like Shiny. The reference J.P.Morgan / Reuters methodology paper can be consulted in the RiskMetrics Technical Document - Fourth Edition 1996, December.

RiskMetrics is a set of tools that enables financial markets players to estimate their exposure to market risk, under what has been called the 'Value-at-Risk framework', in portfolios of foreign exchange, fixed income, equity and commodity products.

The RiskMetrics approach shown in the app is called 'structured Monte Carlo simulation' (RMMC), it involves creating a large number of possible rate scenarios and revaluing the instrument under each of these scenarios. VaR is then defined as the 5th or 1st percentile of the distribution of value changes. This approach is computationally intensive and can only be run with a small simulation size in this prototype.

Instructions:
Visualize first the inputs in the 'Input' page, optionally upload your own input file following the constraints in the page guidelines.
By default, the historical closing prices from Yahoo Finance of the following 5 Swiss companies are taken to construct an example portfolio of the model:
    • (CB) Chubb Limited Common Stock
    • (JCI) Johnson Controls International plc Ordinary Share
    • (RIG) Transocean Ltd (Switzerland) Common Stock
    • (STM) STMicroelectronics N.V. Common Stock
    • (UBS) UBS Group AG Registered Ordinary Shares
Other assets from Yahoo Finance can be chosen among Swiss companies present on Nasdaq.
In the 'Parameters & Model' page, select a time window, parameterize and run the model. Visualize the results in the output graph and table.

Results:
The graph displays the log returns and the corresponding calculated VaR (Value at Risk) and ES (Expected Shortfall) for each time point and simulation of the chosen portfolio. The Risk Measures in the output table express the possible loss with probability (1-p), and the % loss with respect to the present value (PV) of the whole portfolio and of each single asset. The portfolio is assumed to contain 5 shares of each asset.

Instructions:

The historical closing prices of the 5 Swiss assets on Nasdaq with the gratest Volume construct the default portfolio:
(CB) Chubb Limited Common Stock
(JCI) Johnson Controls International plc Ordinary Share
(RIG) Transocean Ltd (Switzerland) Common Stock
(STM) STMicroelectronics N.V. Common Stock
(UBS) UBS Group AG Registered Ordinary Shares .

A user can either:

1) Build a portfolio choosing 'n' assets: The choices include symbols present on Nasdaq (processed in USD).

2) Upload data in 'csv' file format:
  • the first column must be called 'Date' (yyyy-mm-dd), followed by numeric columns
  • the column names will be used as asset names
  • use at least 2 assets
  • add '.Close' '.Open' '.Low' '.High' '.Volume' suffixes to the Asset name if more info on the asset is available.
Download the Yahoo current input portfolio to get an example of a csv input file with 'Comma Separator' and 'Quote None' (here assets have 'Close' 'Open' 'Low' 'High' and 'Volume' details).

Dates where at least one asset is missing are removed from the portfolio.
Closing prices are used by the model.

Download

Overview Assets

Select Time window

Portfolio composition

Summary Portfolio

RMCC model parameters

Parameters specific to the Risk Metrics Monte Carlo (RMMC) model

Set the parameters on the left and click 'Run' once they are ready. The output plot and table will be shown below after the calculation is completed.

'PF' will denote the aggregated portfolio, consisting of 5 shares per Asset.




Model results