← All procedures
statistics.runningOf
This function gives the summary of the values of a list or another iterable, in their order.
CLI- Package
- @procedures/statistics · README
- Path
["statistics","runningOf"]- CLI
mark statistics runningOf --values <number[]>- As data
{"$proc":["statistics","runningOf"],"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","runningOf"], { values: [] });
console.log(JSON.stringify(result));From the command line
$ mark statistics runningOf --values <number[]>
As data, in a program
{ "$proc": ["statistics", "runningOf"], "input": { "values": [] } }Input
Output
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"values": {
"type": "array",
"items": {
"type": "number"
},
"x-procedures-codec": "iterable"
}
},
"required": [
"values"
],
"additionalProperties": false
},
"output": {
"type": "object",
"properties": {
"n": {
"type": "number",
"description": "The count of the values."
},
"sum": {
"type": "number",
"description": "The sum of the values, added in their order."
},
"min": {
"type": "number",
"description": "The smallest value, or `Infinity` for no value."
},
"max": {
"type": "number",
"description": "The largest value, or `-Infinity` for no value."
},
"m2": {
"type": "number",
"description": "The sum of the squares of the differences from the mean (Welford). `runningSd` reads it."
}
},
"required": [
"n",
"sum",
"min",
"max",
"m2"
],
"additionalProperties": {}
}
}