Monte Carlo Risk Attribution¶
The Monte Carlo Risk Attribution worker calculates the contribution to overall portfolio risk from each security using Marginal Contribution to Total Risk (MCTR), and returns the results as a datastore.

Parameters¶
Input¶
| Field | Description |
|---|---|
| Portfolio | The target portfolio. Accepts Fixed Portfolio, Get Latest, or Upstream Data |
| Workspace | Workspace of the portfolio. Accepts Fixed Workspace. Defaults to the current workspace |
| VaR | Whether to calculate VaR at the MCTR and/or Portfolio level. Accepts Boolean |
| CVaR | Whether to calculate Conditional VaR at the MCTR and/or Portfolio level. Accepts Boolean |
| Volatility | Whether to calculate volatility at the MCTR and/or Portfolio level. Accepts Boolean |

Output¶
| Field | Description |
|---|---|
| Name | Name of the output datastore. Accepts Template Text or Upstream Data. Defaults to the portfolio name |
| Date | Date of the output datastore. Accepts Fixed Date or Upstream Data. Defaults to the portfolio date |
| Workspace | Workspace where the output datastore will be saved. Accepts Fixed Workspace. Defaults to the portfolio workspace |
| Tags | Tags for the output datastore. Accepts Fixed Tags or Upstream Data. Defaults to the portfolio tags |
| Storage Mode | Transient — exists only within the current workflow run (default); Create — saves the datastore to the platform |

Advanced¶
| Field | Description |
|---|---|
| Header Suffix | Suffix appended to the end of property column names in the output datastore. Accepts Template Text or Upstream Data. Default is no suffix |
| Horizon | The forecast horizon for calculation. Produces a range of outcomes for each security via their underlying factors across a specific date range. Default is 1-day forecast. See Simulation Horizon |
| Sampling | Frequency at which historical prices and rates are sampled to compute risk factors. Use 1 for daily, 5 for weekly (non-overlapping). Default is 1 |
| Volatility Half-Life | Half-life of volatility information in months. Default is 2 months |
| Correlation Half-Life | Half-life of correlation information in months. Default is 6 months |
| Confidence | Confidence level for calculation. For example, at 95% confidence with 10,000 simulations, the first 5% (500 samples) are used. Default is 95% |
| Posterior Model | Controls the posterior model used in the simulation. See the Everysk Risk Methodology White Paper for details |
| Projection | User-supplied array of securities used as a top-down factor model. Accepts Symbol. Defaults to IND:SPX |

Result¶
Once the worker finishes successfully, it returns a result object containing the datastore. You can check the Output Types article to learn more about result object types.
- Datastore (datastore)
- ID (string)
- Name (string)
- Date (date)
- Tags (list of strings)
- Data (list of lists)
The Data component includes the following columns:
sec_monte_carlo_cvarport_monte_carlo_cvarsec_monte_carlo_varport_monte_carlo_varsec_monte_carlo_volport_monte_carlo_vol