---
title: "Random Portfolio Simulation"
method: POST
path: "/portfolios/simulation/random"
tags: ["Portfolio Simulation"]
---

# Random Portfolio Simulation

`POST /portfolios/simulation/random`

Simulate random assets weights, optionally subject to: 
* Minimum and maximum number of assets constraint
* Minimum and maximum weights constraints
* Minimum and maximum group weights constraints
* Minimum and maximum portfolio exposure constraints

> Due to the nature of the endpoint, subsequent calls with the same input data will result in different output data.

References
* [Surz, R. J. 1994. Portfolio opportunity distributions: an innovation in performance evaluation. The Journal of Investing, 3(2): 36-41](https://www.pm-research.com/content/iijinvest/3/2/36)
* [Burns, P. (2007). Random Portfolios for Performance Measurement. In: Kontoghiorghes, E.J., Gatu, C. (eds) Optimisation, Econometric and Financial Analysis. Advances in Computational Management Science, vol 9. Springer, Berlin, Heidelberg](https://link.springer.com/chapter/10.1007/3-540-36626-1_11)

## Request body

- object
  - `assets` integer, required — The number of assets
  - `simulations` integer — The number of simulations to perform
  - `constraints` object
    - `minimumAssets` integer — The minimum number of assets present in the portfolio
    - `maximumAssets` integer — The maximum number of assets present in the portfolio
    - `minimumAssetsWeights` number[] — minimumAssetsWeights[i] is the minimum weight of the asset i in the portfolio, in percentage
    - `maximumAssetsWeights` number[] — maximumAssetsWeights[i] is the maximum weight of the asset i in the portfolio, in percentage
    - `assetsGroups` array[]
      - integer[] — assetsGroups[k] is the indexes of the assets belonging to the assets group k in the portfolio; exclusive with assetsGroupsMatrix
    - `assetsGroupsMatrix` array[] — assetsGroupsMatrix[k][i] is the weight of the asset i in the group of assets k; exclusive with assetsGroups
      - number[]
    - `maximumAssetsGroupsWeights` number[] — maximumAssetsGroupsWeights[k] is the maximum weight of the assets group k in the portfolio, in percentage between 0 and 1 if assetsGroups is provided
    - `minimumPortfolioExposure` number — The minimum portfolio exposure; must be lower than or equal to maximumPortfolioExposure
    - `maximumPortfolioExposure` number — The maximum portfolio exposure; must be higher than or equal to minimumPortfolioExposure

## Response `200`

OK

- object
  - `simulations` object[], required
    - `portfolios` object[], required
      - `assetsWeights` number[], required — assetsWeights[i] is the weight of the asset i in the portfolio, in percentage

---

[API](https://skmtc.net/portfoliooptimizer/apis/portfolio-optimizer.md) · [All operations](https://skmtc.net/portfoliooptimizer/apis/portfolio-optimizer/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/portfoliooptimizer/portfolio-optimizer/revisions/d016f340e91c/schema)
