StandardNormal
in package
uses
ArrayEnabled
Table of Contents
Properties
Methods
- cumulative() : array<string|int, mixed>|float|string
- NORMSDIST.
- distribution() : array<string|int, mixed>|float|string
- NORM.S.DIST.
- gauss() : array<string|int, mixed>|float|string
- GAUSS.
- inverse() : array<string|int, mixed>|float|string
- NORMSINV.
- zTest() : array<string|int, mixed>|float|string
- ZTEST.
- evaluateArrayArguments() : array<string|int, mixed>
- Handles array argument processing when the function accepts multiple arguments, and any of them can be an array argument.
- evaluateArrayArgumentsIgnore() : array<string|int, mixed>
- Handles array argument processing when the function accepts multiple arguments, and any of them can be an array argument except for the one specified by ignore.
- evaluateArrayArgumentsSubset() : array<string|int, mixed>
- Handles array argument processing when the function accepts multiple arguments, but only the first few (up to limit) can be an array arguments.
- evaluateArrayArgumentsSubsetFrom() : array<string|int, mixed>
- Handles array argument processing when the function accepts multiple arguments, but only the last few (from start) can be an array arguments.
- evaluateSingleArgumentArray() : array<string|int, mixed>
- Handles array argument processing when the function accepts a single argument that can be an array argument.
- initialiseHelper() : void
- testFalse() : bool
Properties
$arrayArgumentHelper
private
static ArrayArgumentHelper
$arrayArgumentHelper
$initializationNeeded
private
static bool
$initializationNeeded
= true
Methods
cumulative()
NORMSDIST.
public
static cumulative(mixed $value) : array<string|int, mixed>|float|string
Returns the standard normal cumulative distribution function. The distribution has a mean of 0 (zero) and a standard deviation of one. Use this function in place of a table of standard normal curve areas.
NOTE: We don't need to check for arrays to array-enable this function, because that is already handled by the logic in Normal::distribution() All we need to do is pass the value through as scalar or as array.
Parameters
- $value : mixed
-
Float value for which we want the probability Or can be an array of values
Return values
array<string|int, mixed>|float|string —The result, or a string containing an error If an array of numbers is passed as an argument, then the returned result will also be an array with the same dimensions
distribution()
NORM.S.DIST.
public
static distribution(mixed $value, mixed $cumulative) : array<string|int, mixed>|float|string
Returns the standard normal cumulative distribution function. The distribution has a mean of 0 (zero) and a standard deviation of one. Use this function in place of a table of standard normal curve areas.
NOTE: We don't need to check for arrays to array-enable this function, because that is already handled by the logic in Normal::distribution() All we need to do is pass the value and cumulative through as scalar or as array.
Parameters
- $value : mixed
-
Float value for which we want the probability Or can be an array of values
- $cumulative : mixed
-
Boolean value indicating if we want the cdf (true) or the pdf (false) Or can be an array of values
Return values
array<string|int, mixed>|float|string —The result, or a string containing an error If an array of numbers is passed as an argument, then the returned result will also be an array with the same dimensions
gauss()
GAUSS.
public
static gauss(mixed $value) : array<string|int, mixed>|float|string
Calculates the probability that a member of a standard normal population will fall between the mean and z standard deviations from the mean.
Parameters
- $value : mixed
-
Or can be an array of values
Return values
array<string|int, mixed>|float|string —The result, or a string containing an error If an array of numbers is passed as an argument, then the returned result will also be an array with the same dimensions
inverse()
NORMSINV.
public
static inverse(mixed $value) : array<string|int, mixed>|float|string
Returns the inverse of the standard normal cumulative distribution
Parameters
- $value : mixed
-
float probability for which we want the value Or can be an array of values
NOTE: We don't need to check for arrays to array-enable this function, because that is already handled by the logic in Normal::inverse() All we need to do is pass the value through as scalar or as array
Return values
array<string|int, mixed>|float|string —The result, or a string containing an error If an array of numbers is passed as an argument, then the returned result will also be an array with the same dimensions
zTest()
ZTEST.
public
static zTest(mixed $dataSet, mixed $m0[, mixed $sigma = null ]) : array<string|int, mixed>|float|string
Returns the one-tailed P-value of a z-test.
For a given hypothesized population mean, x, Z.TEST returns the probability that the sample mean would be greater than the average of observations in the data set (array) — that is, the observed sample mean.
Parameters
- $dataSet : mixed
-
The dataset should be an array of float values for the observations
- $m0 : mixed
-
Alpha Parameter Or can be an array of values
- $sigma : mixed = null
-
A null or float value for the Beta (Standard Deviation) Parameter; if null, we use the standard deviation of the dataset Or can be an array of values
Return values
array<string|int, mixed>|float|string —(string if result is an error) If an array of numbers is passed as an argument, then the returned result will also be an array with the same dimensions
evaluateArrayArguments()
Handles array argument processing when the function accepts multiple arguments, and any of them can be an array argument.
protected
static evaluateArrayArguments(callable $method, mixed ...$arguments) : array<string|int, mixed>
Example use for: ROUND() or DATE().
Parameters
- $method : callable
- $arguments : mixed
Return values
array<string|int, mixed>evaluateArrayArgumentsIgnore()
Handles array argument processing when the function accepts multiple arguments, and any of them can be an array argument except for the one specified by ignore.
protected
static evaluateArrayArgumentsIgnore(callable $method, int $ignore, mixed ...$arguments) : array<string|int, mixed>
Example use for: HLOOKUP() and VLOOKUP(), where argument 1 is a matrix that needs to be treated as a database rather than as an array argument.
Parameters
- $method : callable
- $ignore : int
- $arguments : mixed
Return values
array<string|int, mixed>evaluateArrayArgumentsSubset()
Handles array argument processing when the function accepts multiple arguments, but only the first few (up to limit) can be an array arguments.
protected
static evaluateArrayArgumentsSubset(callable $method, int $limit, mixed ...$arguments) : array<string|int, mixed>
Example use for: NETWORKDAYS() or CONCATENATE(), where the last argument is a matrix (or a series of values) that need to be treated as a such rather than as an array arguments.
Parameters
- $method : callable
- $limit : int
- $arguments : mixed
Return values
array<string|int, mixed>evaluateArrayArgumentsSubsetFrom()
Handles array argument processing when the function accepts multiple arguments, but only the last few (from start) can be an array arguments.
protected
static evaluateArrayArgumentsSubsetFrom(callable $method, int $start, mixed ...$arguments) : array<string|int, mixed>
Example use for: Z.TEST() or INDEX(), where the first argument 1 is a matrix that needs to be treated as a dataset rather than as an array argument.
Parameters
- $method : callable
- $start : int
- $arguments : mixed
Return values
array<string|int, mixed>evaluateSingleArgumentArray()
Handles array argument processing when the function accepts a single argument that can be an array argument.
protected
static evaluateSingleArgumentArray(callable $method, array<string|int, mixed> $values) : array<string|int, mixed>
Example use for: DAYOFMONTH() or FACT().
Parameters
- $method : callable
- $values : array<string|int, mixed>
Return values
array<string|int, mixed>initialiseHelper()
private
static initialiseHelper(array<string|int, mixed>|false $arguments) : void
Parameters
- $arguments : array<string|int, mixed>|false
-
Can be changed to array for Php8.1+
testFalse()
private
static testFalse(mixed $value) : bool
Parameters
- $value : mixed