Catalog/gt-discrete-expectation

Game Theory

Discrete expected value API

Computes the mean, variance, standard deviation and skewness of a discrete distribution given values and matching probabilities (validated to sum to 1). Answers 'What is E[X] and Var(X) for this payoff distribution?', 'Expected value and spread of a discrete random variable?'.

Price$0.04per request
MethodPOST
Route/v1/gametheory/discrete-expectation
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
probabilityexpected-valuevariancemomentsdiscretedistributionskewnessstatistics
API URLhttps://x402.hexl.dev/v1/gametheory/discrete-expectation
Integration docs
Example request
{
  "values": [
    1,
    2,
    3,
    4,
    5,
    6
  ],
  "probabilities": [
    0.16666666666666666,
    0.16666666666666666,
    0.16666666666666666,
    0.16666666666666666,
    0.16666666666666666,
    0.16666666666666666
  ]
}
Example response
{
  "n": 6,
  "expectedValue": 3.5,
  "variance": 2.91666667,
  "standardDeviation": 1.70782513,
  "skewness": 0,
  "secondMoment": 15.16666667,
  "interpretation": "E[X] = 3.5, Var(X) = 2.9167, SD = 1.7078 for the discrete distribution."
}
Input schema
{
  "type": "object",
  "required": [
    "values",
    "probabilities"
  ],
  "properties": {
    "values": {
      "type": "array",
      "items": {
        "type": "number"
      },
      "examples": [
        [
          1,
          2,
          3,
          4,
          5,
          6
        ]
      ]
    },
    "probabilities": {
      "type": "array",
      "items": {
        "type": "number"
      },
      "examples": [
        [
          0.16666666666666666,
          0.16666666666666666,
          0.16666666666666666,
          0.16666666666666666,
          0.16666666666666666,
          0.16666666666666666
        ]
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}