Skip to main content

Probability

Probability utility functions

Functions

boxMuller

Probability.boxMuller() → number

Returns a boxMuller random distribution

normal

Probability.normal(
meannumber,
standardDeviationnumber
) → number

Returns a normal distribution

boundedNormal

Probability.boundedNormal(
meannumber,
standardDeviationnumber,
hardMinnumber,
hardMaxnumber
) → number

Returns a bounded normal, clamping the normal value

erf

Probability.erf(xnumber) → number

Approximation of the error function (erf) using the Abramowitz and Stegun formula

https://en.wikipedia.org/wiki/Error_function

cdf

Probability.cdf(zScorenumber) → number

Standard normal cumulative distribution function. Returns the value from 0 to 1.

This is also known as percentile!

erfinv

Probability.erfinv(xnumber) → number

Function to calculate the inverse error function (erfinv) using Newton's method

percentileToZScore

Probability.percentileToZScore(percentilenumber) → number

Standard normal cumulative distribution function. Returns the value from 0 to 1.

This is also known as percentile!

Show raw api
{
    "functions": [
        {
            "name": "boxMuller",
            "desc": "Returns a boxMuller random distribution",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 12,
                "path": "src/probability/src/Shared/Probability.lua"
            }
        },
        {
            "name": "normal",
            "desc": "Returns a normal distribution",
            "params": [
                {
                    "name": "mean",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "standardDeviation",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 22,
                "path": "src/probability/src/Shared/Probability.lua"
            }
        },
        {
            "name": "boundedNormal",
            "desc": "Returns a bounded normal, clamping the normal value",
            "params": [
                {
                    "name": "mean",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "standardDeviation",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "hardMin",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "hardMax",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 34,
                "path": "src/probability/src/Shared/Probability.lua"
            }
        },
        {
            "name": "erf",
            "desc": "Approximation of the error function (erf) using the Abramowitz and Stegun formula\n\nhttps://en.wikipedia.org/wiki/Error_function",
            "params": [
                {
                    "name": "x",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 46,
                "path": "src/probability/src/Shared/Probability.lua"
            }
        },
        {
            "name": "cdf",
            "desc": "Standard normal cumulative distribution function. Returns the value from 0 to 1.\n\nThis is also known as percentile!",
            "params": [
                {
                    "name": "zScore",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 73,
                "path": "src/probability/src/Shared/Probability.lua"
            }
        },
        {
            "name": "erfinv",
            "desc": "Function to calculate the inverse error function (erfinv) using Newton's method",
            "params": [
                {
                    "name": "x",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 85,
                "path": "src/probability/src/Shared/Probability.lua"
            }
        },
        {
            "name": "percentileToZScore",
            "desc": "Standard normal cumulative distribution function. Returns the value from 0 to 1.\n\nThis is also known as percentile!",
            "params": [
                {
                    "name": "percentile",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 124,
                "path": "src/probability/src/Shared/Probability.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "Probability",
    "desc": "Probability utility functions",
    "source": {
        "line": 5,
        "path": "src/probability/src/Shared/Probability.lua"
    }
}