← All procedures

statistics.ratingToStrength

The log-strength of a rating. It is the inverse of `strengthToRating` with the same options.

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

From the command line

$ mark statistics ratingToStrength --rating <number>

As data, in a program

{
  "$proc": ["statistics", "ratingToStrength"],
  "input": { "rating": 1 }
}

Input

FieldTypeRequiredDefaultDescription
ratingnumberyes
optionsobjectno

Output

The schema does not list fields (number).

JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "rating": {
        "type": "number"
      },
      "options": {
        "type": "object",
        "properties": {
          "center": {
            "type": "number",
            "description": "The rating of the log-strength 0. The default is 1500. Elo uses only differences, so it does not read it."
          },
          "scale": {
            "type": "number",
            "description": "The number of points that gives odds of `base` to 1. The default is 400."
          },
          "base": {
            "type": "number",
            "description": "The base of the odds. The default is 10."
          }
        },
        "additionalProperties": {}
      }
    },
    "required": [
      "rating"
    ],
    "additionalProperties": false
  },
  "output": {
    "type": "number"
  }
}