statistics.strengthToRating
The rating of a log-strength: `center + scale * strength / ln(base)`. The defaults give `1500 + 400 * log10(e) * strength`. Thus `eloExpected` of two ratings is the Bradley-Terry win probability.
CLI- Package
- @procedures/statistics · README
- Path
["statistics","strengthToRating"]- CLI
mark statistics strengthToRating --strength <number>- As data
{"$proc":["statistics","strengthToRating"],"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","strengthToRating"], { strength: 1 });
console.log(JSON.stringify(result));From the command line
$ mark statistics strengthToRating --strength <number>
As data, in a program
{
"$proc": ["statistics", "strengthToRating"],
"input": { "strength": 1 }
}Input
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
strength | number | yes | ||
options | object | no |
Output
The schema does not list fields (number).
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"strength": {
"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": [
"strength"
],
"additionalProperties": false
},
"output": {
"type": "number"
}
}