Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

quantile

Compute a type-7 empirical quantile with linear interpolation.

Contract

The output describes the empirical distribution, not a confidence interval for a parameter. Samples must be finite and nonempty; q includes endpoints zero and one.

Fields

FieldTypeRequired
op"quantile"Yes
qProbabilityYes
samplesarray of numberYes

This operation needs no existing question or forecast. Use --memory for a calculation-only session.

Request

Send this object on one line. It is expanded below for readability.

{
  "version": 1,
  "id": "example",
  "command": {
    "op": "quantile",
    "samples": [
      1.0,
      1.1,
      1.2,
      1.5,
      4.0
    ],
    "q": 0.8
  }
}

Response

This response is generated by executing the example against the current binary. Commit timestamps, when present, are shown as <runtime UTC seconds>; the actual protocol returns integer UTC seconds.

{
  "version": 1,
  "id": "example",
  "result": {
    "method": "linear_type_7",
    "quantile": 2.0000000000000004
  }
}

Verification

The documentation gate executes the setup and request, then checks the following result fields against independently specified expectations:

JSON pointer within resultExpected
/quantile2.0
/method"linear_type_7"

Float comparisons use a 1e-12 tolerance. Request schema validation and cross-record validation still apply. See errors and recovery for failure handling.