Catalog/util-stats

Utilities

Statistics & linear regression API

Descriptive statistics for one numeric array (n, mean, median, stdev, variance, min/max, quartiles), OR ordinary-least-squares linear regression + correlation given x and y arrays. Pure compute. Answers 'stats for these numbers', 'regress y on x', 'correlation between these series', 'fit a trend line', 'standard deviation of'.

Price$0.01per request
MethodPOST
Route/v1/util/stats
StatusLive
MIME typeapplication/json
Rate limit120/minute
CacheNo cache
utilstatisticsregressionolscorrelationquantmeanstdev
API URLhttps://x402.hexl.dev/v1/util/stats
Integration docs
Example request
{
  "x": [
    1,
    2,
    3,
    4
  ],
  "y": [
    2,
    4,
    6,
    8
  ]
}
Example response
{
  "mode": "regression",
  "n": 4,
  "slope": 2,
  "intercept": 0,
  "r": 1,
  "rSquared": 1,
  "correlation": 1,
  "equation": "y = 2x + 0"
}
Input schema
{
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "number"
      }
    },
    "x": {
      "type": "array",
      "items": {
        "type": "number"
      }
    },
    "y": {
      "type": "array",
      "items": {
        "type": "number"
      }
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}