Scalar functions
normalDistribution
Commentary
added in 0.0.5
Generates numbers according to a normal distribution curve.
Examples
Generating decimal numbers
By default, this function generates floating point numbers.
{
"_gen": "normalDistribution",
"mean": 100,
"sd": 20
}
[
92.84386649596675,
120.27197827440959,
104.97754099397618,
102.7352300434932,
115.27256749558076
]
Generating integers
Use the decimals
function modifier to generate integers.
{
"_gen": "normalDistribution",
"mean": 500,
"sd": 15,
"decimals": 0
}
[
502,
488,
502,
483,
496
]
Specification
JSON schema
{
"type": "object",
"properties": {
"mean": {
"oneOf": [
{
"type": "number"
},
{
"type": "object",
"properties": {
"_gen": {
"type": "string"
}
},
"required": [
"_gen"
]
}
]
},
"sd": {
"oneOf": [
{
"type": "number"
},
{
"type": "object",
"properties": {
"_gen": {
"type": "string"
}
},
"required": [
"_gen"
]
}
]
},
"decimals": {
"type": "integer",
"minimum": 0
}
},
"required": [
"mean",
"sd"
]
}