← All procedures

statistics.brier

The Brier score: the mean of (p - outcome)^2. 0 is perfect, and 0.25 is a constant 0.5. Lower is better.

CLI
Package
@procedures/statistics · README
Path
["statistics","brier"]
CLI
mark statistics brier --forecasts <object[]>
As data
{"$proc":["statistics","brier"],"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","brier"], { forecasts: [] });
console.log(JSON.stringify(result));

From the command line

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

As data, in a program

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

Input

FieldTypeRequiredDefaultDescription
forecastsobject[]yes

Output

The schema does not list fields (number).

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": "number"
  }
}