generators.recordedSpec
This function gives the spec of the family `recorded` that draws from a table.
CLI- Package
- @procedures/generators · README
- Path
["generators","recordedSpec"]- CLI
mark generators recordedSpec --table <object>- As data
{"$proc":["generators","recordedSpec"],"input":{}}
Use it
In TypeScript
import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/generators/register"; // registers its procedures
const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["generators","recordedSpec"], { table: {} });
console.log(JSON.stringify(result));From the command line
$ mark generators recordedSpec --table <object>
As data, in a program
{ "$proc": ["generators", "recordedSpec"], "input": { "table": {} } }Input
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
table | object | yes |
Output
The schema does not list fields (object | object | object | object | object | object).
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"table": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name of the table."
},
"measure": {
"type": "string",
"description": "What one value measures."
},
"source": {
"type": "string",
"description": "The link to the source, with the commit of the read."
},
"license": {
"type": "string",
"description": "The license of the source."
},
"notice": {
"type": "string",
"description": "The notice of the license of the source, or an empty string when it has no notice."
},
"date": {
"type": "string",
"description": "The date of the read."
},
"count": {
"type": "number",
"description": "The count of the recorded values."
},
"median": {
"type": "number",
"description": "The median of the recorded values."
},
"quantiles": {
"type": "array",
"items": {
"type": "number"
},
"description": "The 100 midpoint quantiles, from the lowest to the highest. The value at index `i` has the rank `floor(count * (i + 0.5) / 100)` of the sorted values. Each value thus stands for 1 percent of the recorded values."
}
},
"required": [
"name",
"measure",
"source",
"license",
"notice",
"date",
"count",
"median",
"quantiles"
],
"additionalProperties": {}
}
},
"required": [
"table"
],
"additionalProperties": false
},
"output": {
"anyOf": [
{
"type": "object",
"properties": {
"family": {
"type": "string",
"const": "beta"
},
"a": {
"anyOf": [
{
"type": "number"
},
{
"type": "array",
"items": [
{
"type": "number"
},
{
"type": "number"
}
],
"additionalItems": {},
"minItems": 2,
"maxItems": 2
}
]
},
"b": {
"anyOf": [
{
"type": "number"
},
{
"type": "array",
"items": [
{
"type": "number"
},
{
"type": "number"
}
],
"additionalItems": {},
"minItems": 2,
"maxItems": 2
}
]
}
},
"required": [
"family",
"a",
"b"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"family": {
"type": "string",
"const": "lognormal"
},
"mu": {
"anyOf": [
{
"type": "number"
},
{
"type": "array",
"items": [
{
"type": "number"
},
{
"type": "number"
}
],
"additionalItems": {},
"minItems": 2,
"maxItems": 2
}
]
},
"sigma": {
"anyOf": [
{
"type": "number"
},
{
"type": "array",
"items": [
{
"type": "number"
},
{
"type": "number"
}
],
"additionalItems": {},
"minItems": 2,
"maxItems": 2
}
]
}
},
"required": [
"family",
"mu",
"sigma"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"family": {
"type": "string",
"const": "mixture"
},
"parts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"weight": {
"type": "number"
},
"part": {
"allOf": [
{
"$ref": "#"
}
]
}
},
"required": [
"weight",
"part"
],
"additionalProperties": {}
}
}
},
"required": [
"family",
"parts"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"family": {
"type": "string",
"const": "pareto"
},
"scale": {
"anyOf": [
{
"type": "number"
},
{
"type": "array",
"items": [
{
"type": "number"
},
{
"type": "number"
}
],
"additionalItems": {},
"minItems": 2,
"maxItems": 2
}
]
},
"shape": {
"anyOf": [
{
"type": "number"
},
{
"type": "array",
"items": [
{
"type": "number"
},
{
"type": "number"
}
],
"additionalItems": {},
"minItems": 2,
"maxItems": 2
}
]
}
},
"required": [
"family",
"scale",
"shape"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"family": {
"type": "string",
"const": "recorded"
},
"values": {
"type": "array",
"items": {
"type": "number"
}
}
},
"required": [
"family",
"values"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"family": {
"type": "string",
"const": "zipf"
},
"n": {
"type": "number"
},
"exponent": {
"anyOf": [
{
"type": "number"
},
{
"type": "array",
"items": [
{
"type": "number"
},
{
"type": "number"
}
],
"additionalItems": {},
"minItems": 2,
"maxItems": 2
}
]
}
},
"required": [
"family",
"n",
"exponent"
],
"additionalProperties": {}
}
]
}
}