agi.foundation
(agi.foundation.core-2023r1.jar)

## Class GaussianStatistics

• ```public final class GaussianStatistics
extends Object```
Provides static methods helpful when working with Gaussian functions.
• ### Method Summary

All Methods
Modifier and Type Method and Description
`static double` `complementaryErrorFunction(double x)`
`static double` `errorFunction(double x)`
Calculates the error function for all values of x.
`static double` `inverseComplementaryErrorFunction(double p)`
Calculates the inverse of the complementary error function.
`static double` `inverseErrorFunction(double p)`
Calculates the inverse of the error function.
`static double` ```multiDimensionalConfidenceIntervals(int dimension, double sigmas)```
Calculates the fraction of the probability distribution of a specified dimension that lies within the confidence interval described by the specified number of standard deviations.
`static double` ```multiDimensionalStandardDeviationFactor(int dimension, double probability)```
Calculates the number of standard deviations that describe the confidence interval which makes up the given portion of the probability distribution.
• ### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ### Method Detail

• #### errorFunction

`public static double errorFunction(double x)`
Calculates the error function for all values of x.
Parameters:
`x` - The value to calculate the error function of.
Returns:
The error function of the given value.
• #### complementaryErrorFunction

`public static double complementaryErrorFunction(double x)`
Calculates the complement of `GaussianStatistics.errorFunction(double)`. By definition this complement plus the error function are equal to one.
Parameters:
`x` - The value to use to calculate the complement of the error function.
Returns:
The complement of the error function of the given value.
• #### inverseComplementaryErrorFunction

`public static double inverseComplementaryErrorFunction(double p)`
Calculates the inverse of the complementary error function.

The `GaussianStatistics.complementaryErrorFunction(double)` approaches its asymptote very quickly, at double precision its solutions are rounded to 0.0 or 2.0 at an input of +-5.93. If this method returns negative or positive infinity and a finite value must be used instead, anything outside of that range would make an acceptable substitute.

Parameters:
`p` - The value to use to calculate the inverse of the complementary error function, from 0.0 to 2.0.
Returns:
The inverse of the complementary error function.
• #### inverseErrorFunction

`public static double inverseErrorFunction(double p)`
Calculates the inverse of the error function.

The `GaussianStatistics.errorFunction(double)` approaches its asymptote very quickly, at double precision its solutions are rounded to -1.0 or 1.0 at an input of +-5.93. If this method returns negative or positive infinity and a finite value must be used instead, anything outside of that range would make an acceptable substitute.

Parameters:
`p` - The value to use to calculate the inverse of the error function, from -1.0 to 1.0.
Returns:
The inverse of the error function.
• #### multiDimensionalConfidenceIntervals

```public static double multiDimensionalConfidenceIntervals(int dimension,
double sigmas)```
Calculates the fraction of the probability distribution of a specified dimension that lies within the confidence interval described by the specified number of standard deviations.
Parameters:
`dimension` - The dimension of the gaussian probability distribution.
`sigmas` - The width of the confidence interval in standard deviations.
Returns:
The fraction of the probability distribution within the confidence interval, between 0.0 and 1.0.
• #### multiDimensionalStandardDeviationFactor

```public static double multiDimensionalStandardDeviationFactor(int dimension,
double probability)```
Calculates the number of standard deviations that describe the confidence interval which makes up the given portion of the probability distribution.
Parameters:
`dimension` - The dimension of the gaussian probability distribution.
`probability` - The desired probability that an event in the probability distribution lies in the confidence interval described by the returned number of standard deviations, from 0.0 to 1.0;
Returns:
The number of standard deviations necessary to provide the specified confidence interval.