StudentT
in package
uses
ArrayEnabled
Some of this code is drived from Perl CPAN Statistical::Distributions.
Its copyright statement is: Copyright 2003 Michael Kospach. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Table of Contents
Methods
- distribution() : array<string|int, mixed>|float|string
- TDIST.
- inverse() : array<string|int, mixed>|float|string
- TINV and T.INV.2T.
- tDotDist() : array<string|int, mixed>|float|string
- T.DIST.
- tDotDistDot2T() : array<string|int, mixed>|float|string
- T.DIST.2T.
- tDotDistDotRT() : array<string|int, mixed>|float|string
- T.DIST.RT.
- tDotInv() : array<string|int, mixed>|float|string
- T.INV.
- 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.
Methods
distribution()
TDIST.
public
static distribution(mixed $value, mixed $degrees, mixed $tails) : array<string|int, mixed>|float|string
Returns the probability of Student's T distribution.
Parameters
- $value : mixed
-
Float value for the distribution Or can be an array of values
- $degrees : mixed
-
Integer value for degrees of freedom Or can be an array of values
- $tails : mixed
-
Integer value for the number of tails (1 or 2) 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()
TINV and T.INV.2T.
public
static inverse(mixed $probability, mixed $degrees) : array<string|int, mixed>|float|string
Returns the two-tailed inverse of the Student t distribution.
Parameters
- $probability : mixed
-
Float probability for the function Or can be an array of values
- $degrees : mixed
-
Integer value for degrees of freedom 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
tDotDist()
T.DIST.
public
static tDotDist(mixed $value, mixed $degrees, mixed $cumulative) : array<string|int, mixed>|float|string
Returns the Student's left-tailed t distribution, either as a cumulative distribution function (cdf) (TRUE) or as a probability density function (pdf) (FALSE), where TRUE/FALSE are the value of $cumulative parameter.
"True" algoritm adapted from java. org.apache.commons.math3.distribution.TDistribution. "False" algorithm comes from: https://statproofbook.github.io/P/t-pdf.html
Parameters
- $value : mixed
- $degrees : mixed
- $cumulative : mixed
-
Expecting bool. See above for explanation.
Return values
array<string|int, mixed>|float|string —The result, or a string containing an error
tDotDistDot2T()
T.DIST.2T.
public
static tDotDistDot2T(mixed $value, mixed $degrees) : array<string|int, mixed>|float|string
Returns the two-tailed Student's t distribution.
Parameters
- $value : mixed
- $degrees : mixed
Return values
array<string|int, mixed>|float|string —The result, or a string containing an error
tDotDistDotRT()
T.DIST.RT.
public
static tDotDistDotRT(mixed $value, mixed $degrees) : array<string|int, mixed>|float|string
Returns the right-tailed Student's t distribution.
Parameters
- $value : mixed
- $degrees : mixed
Return values
array<string|int, mixed>|float|string —The result, or a string containing an error
tDotInv()
T.INV.
public
static tDotInv(mixed $probability, mixed $degrees) : array<string|int, mixed>|float|string
Returns the left-tailed inverse of the Student's t distribution.
Based on code from Perl CPAN Statistical::Distributions.
Parameters
- $probability : mixed
- $degrees : mixed
Return values
array<string|int, mixed>|float|string —The result, or a string containing an error
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>