sample_statistics library
Utilities and functions for calculating sample statistics and generating random samples.
Classes
- InvalidFunctionParameter
-
Stats<
T extends num> - Provides access to basic statistical entities of a numerical random sample.
Extensions
- Differentiation on NumericalFunction
- Factorial on int
-
Adds the getter
factorial
. - FunctionTable on NumericalFunction
-
Extension providing the methods
export
andtable
. - Integration on NumericalFunction
- Root on num
-
Extension on
num
providing the methodroot
. -
StatisticsUtils
on List<
T>
Constants
- epsilon → const num
- Small number used to ensure that a denominator is non-null.
- invSqrt2 → const double
- Constant: 1.0/sqrt(2).
- invSqrt2Pi → const double
- Constant: 1.0/(sqrt(2*pi)).
- invSqrtPi → const double
- Constant: 1.0/(sqrt(pi)).
- sqrt2Pi → const double
- Constant: sqrt(2.0*pi).
- sqrtPi → const double
- Square root of pi.
Properties
-
erf
→ MemoizedFunction<
num, double> -
Returns an approximation of the error function defined as:
final
-
erfc
→ MemoizedFunction<
num, double> -
Returns an approximation of the complementary error function defined as:
final
-
erfcx
→ MemoizedFunction<
num, double> -
Returns an approximation of the complementary scaled error function
defined as:
final
-
erfTable
→ Map<
double, double> -
Error function table. 30-digit precision.
final
-
erfx
→ MemoizedFunction<
num, double> -
Returns an approximation of the scaled error function defined as:
final
-
erfxTable
→ Map<
double, double> -
Scaled error function table 30-digit precision.
final
Functions
-
dxErf(
num x) → double - Returns the first derivative of the error function.
-
expCdf(
num x, num mean) → double -
Exponential cumulative probability density function
with non-zero support over the interval
(0, inf)
. -
exponentialSample(
int sampleSize, num mean, {int? seed}) → List< double> -
Returns a random sample of length
sampleSize
following an exponential distribution. -
expPdf(
num x, num mean) → double -
Exponential density function
with non-zero support over the interval
(0, inf)
. -
meanTruncatedNormal(
num xMin, num xMax, num meanOfParent, num stdDevOfParent) → double -
Returns the mean of a truncated normal distribution
with minimum value
xMin
, maximum valuexMax
, and a parent normal distribution with meanmeanOfParent
, and standard deviationstdDevOfParent
. -
normalCdf(
num x, num mean, num stdDev) → double - Normal cumulative probability density function.
-
normalPdf(
num x, num mean, num stdDev) → double - Normal probability density function.
-
normalSample(
int sampleSize, num mean, num stdDev, {num? xMin, num? xMax, int? seed}) → List< double> -
Returns a random sample with
sampleSize
elements following a normal distribution with parameters: -
randomSample(
int sampleSize, num xMin, num xMax, num yMax, ProbabilityDensity pdf, {int? seed}) → List< double> -
Returns a random sample with probability density
probabilityDensity
. -
stdDevTruncatedNormal(
num xMin, num xMax, num meanOfParent, num stdDevOfParent) → double -
Returns the standard deviation of a truncated normal distribution
with minimum value
xMin
, maximum valuexMax
, and a parent normal distribution with meanmeanOfParent
, and standard deviationstdDevOfParent
. -
stdNormalCdf(
num x) → double - Standard normal cumulative probability distribution.
-
stdNormalPdf(
num x) → double - Standard normal probability density function (with a mean of zero and a standard deviation equal to one) .
-
triangularCdf(
num x, num xMin, num xMax) → double -
Triangular cumulative probability density function
with non-zero support over the interval
(xMin, xMax)
. -
triangularInvCdf(
num p, num xMin, num xMax) → double -
Triangular inverse cumulative probability density function
with non-zero support over the interval
(xMin, xMax)
. -
triangularPdf(
num x, num xMin, num xMax) → double -
Triangular probability density function
with non-zero support over the interval
(xMin, xMax)
. -
triangularSample(
int sampleSize, num xMin, num xMax, {int? seed}) → List< double> -
Returns a random sample following a symmetric triangular distribution with
non-zero support over the range
xMin ... xMax
. -
truncatedNormalCdf(
num x, num xMin, num xMax, num meanOfParent, num stdDevOfParent) → double - Truncated normal cumulative probability density function
-
truncatedNormalPdf(
num x, num xMin, num xMax, num meanOfParent, num stdDevOfParent) → double - Truncated normal probability density function
-
truncatedNormalSample(
int sampleSize, num xMin, num xMax, num meanOfParent, num stdDevOfParent, {int? seed}) → List< double> -
Returns a random sample containing
sampleSize
elements following a truncated normal distribution with: -
truncatedNormalToNormal(
num xMin, num xMax, num meanTruncatedNormal, num stdDevTruncatedNormal, {num stdDevMin = 0.1, num stdDevMax = 5}) → Future< Map< String, num> > -
Returns a
Future<Map<String, num>>
containing the mean and standard deviation of the parent distribution of a truncated normal distribution with: -
uniformCdf(
num x, num xMin, num xMax) → double -
Uniform cumulative probability density function
with non-zero support over the interval
(xMin, xMax)
. -
uniformPdf(
num x, num xMin, num xMax) → double -
Uniform probability density function
with non-zero support over the interval
(xMin, xMax)
. -
uniformSample(
int sampleSize, num xMin, num xMax, {int? seed}) → List< double> -
Returns a random sample following a uniform distribution with
non-zero support over the range
xMin ... xMax
.
Typedefs
- NumericalFunction = double Function(num)
-
Typedef of a function with a single positional parameter of type
T extends num
and return typeT
. - ProbabilityDensity = double Function(num x)
- A probability density function.