Documentation

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

Properties

$arrayArgumentHelper  : ArrayArgumentHelper
$initializationNeeded  : bool

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.
calcDistribution()  : array<string|int, mixed>|float|string
calcInverse()  : array<string|int, mixed>|float|string
initialiseHelper()  : void
subTProb()  : float
Based on code from Perl CPAN Statistical::Distributions.
subU()  : float
Based on code from Perl CPAN Statistical::Distributions.
tDotDistFalse()  : float|string
testFalse()  : bool

Properties

$initializationNeeded

private static bool $initializationNeeded = true

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>
Return values
array<string|int, mixed>

calcDistribution()

private static calcDistribution(mixed $value, mixed $degrees, mixed $tails, callable $callback) : array<string|int, mixed>|float|string
Parameters
$value : mixed
$degrees : mixed
$tails : mixed
$callback : callable
Return values
array<string|int, mixed>|float|string

The result, or a string containing an error

calcInverse()

private static calcInverse(mixed $probability, mixed $degrees, int $tails, callable $callback2) : array<string|int, mixed>|float|string
Parameters
$probability : mixed
$degrees : mixed
$tails : int
$callback2 : callable
Return values
array<string|int, mixed>|float|string

The result, or a string containing an error

initialiseHelper()

private static initialiseHelper(array<string|int, mixed> $arguments) : void
Parameters
$arguments : array<string|int, mixed>

subTProb()

Based on code from Perl CPAN Statistical::Distributions.

private static subTProb(float $x, int $n, int $tails) : float
Parameters
$x : float
$n : int
$tails : int
Return values
float

subU()

Based on code from Perl CPAN Statistical::Distributions.

private static subU(float $p) : float
Parameters
$p : float
Return values
float

tDotDistFalse()

private static tDotDistFalse(float $value, int $degrees) : float|string
Parameters
$value : float
$degrees : int
Return values
float|string

testFalse()

private static testFalse(mixed $value) : bool
Parameters
$value : mixed
Return values
bool

        
On this page

Search results