← All procedures

statistics.calibration

The hit rate of each stated level, from the lowest level.

CLI
Package
@procedures/statistics · README
Path
["statistics","calibration"]
CLI
mark statistics calibration --forecasts <object[]>
As data
{"$proc":["statistics","calibration"],"input":{}}

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/statistics/register"; // registers its procedures

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["statistics","calibration"], { forecasts: [] });
console.log(JSON.stringify(result));

From the command line

$ mark statistics calibration --forecasts <object[]>

As data, in a program

{ "$proc": ["statistics", "calibration"], "input": { "forecasts": [] } }

Input

FieldTypeRequiredDefaultDescription
forecastsobject[]yes

Output

The schema does not list fields (object[]).

JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "forecasts": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "p": {
              "type": "number"
            },
            "hit": {
              "type": "boolean"
            }
          },
          "required": [
            "p",
            "hit"
          ],
          "additionalProperties": {}
        }
      }
    },
    "required": [
      "forecasts"
    ],
    "additionalProperties": false
  },
  "output": {
    "type": "array",
    "items": {
      "type": "object",
      "properties": {
        "stated": {
          "type": "number"
        },
        "n": {
          "type": "number"
        },
        "hits": {
          "type": "number"
        },
        "rate": {
          "type": "number",
          "description": "hits / n. A calibrated level has a rate near `stated`."
        },
        "interval": {
          "type": "object",
          "properties": {
            "low": {
              "type": "number"
            },
            "high": {
              "type": "number"
            }
          },
          "required": [
            "low",
            "high"
          ],
          "additionalProperties": {},
          "description": "The Wilson interval of the rate. A level is overconfident when `stated` is above it."
        }
      },
      "required": [
        "stated",
        "n",
        "hits",
        "rate",
        "interval"
      ],
      "additionalProperties": {}
    }
  }
}