← All procedures
statistics.negativeBinomialInterval
The central interval of a negative binomial count. X is the count of failures before `successes` successes, and `p` is the chance of a success at each try. `low` is the smallest k with P(X <= k) > (1 - level) / 2. `high` is the smallest k with P(X <= k) >= 1 - (1 - level) / 2.
CLI- Package
- @procedures/statistics · README
- Path
["statistics","negativeBinomialInterval"]- CLI
mark statistics negativeBinomialInterval --successes <number> --p <number>- As data
{"$proc":["statistics","negativeBinomialInterval"],"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","negativeBinomialInterval"], { successes: 1, p: 1 });
console.log(JSON.stringify(result));From the command line
$ mark statistics negativeBinomialInterval --successes <number> --p <number>
As data, in a program
{
"$proc": ["statistics", "negativeBinomialInterval"],
"input": { "successes": 1, "p": 1 }
}Input
Output
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"successes": {
"type": "number"
},
"p": {
"type": "number"
},
"level": {
"type": "number"
}
},
"required": [
"successes",
"p"
],
"additionalProperties": false
},
"output": {
"type": "object",
"properties": {
"low": {
"type": "number"
},
"high": {
"type": "number"
},
"coverage": {
"type": "number",
"description": "The chance of a count from `low` to `high`. It is `level` or more."
}
},
"required": [
"low",
"high",
"coverage"
],
"additionalProperties": {}
}
}