SSJ
V. 2.6.

umontreal.iro.lecuyer.probdist Class BetaSymmetricalDist

```java.lang.Object
umontreal.iro.lecuyer.probdist.ContinuousDistribution
umontreal.iro.lecuyer.probdist.BetaSymmetricalDist
```
All Implemented Interfaces:
Distribution

`public class BetaSymmetricalDistextends BetaDist`

Specializes the class `BetaDist` to the case of a symmetrical beta distribution over the interval [0, 1], with shape parameters α = β. Faster methods are implemented here for this special case. Because of the symmetry around 1/2, four series are used to compute the cdf, two around x = 0 and two around x = 1/2.

Field Summary

Fields inherited from class umontreal.iro.lecuyer.probdist.ContinuousDistribution
`decPrec`

Constructor Summary
`BetaSymmetricalDist(double alpha)`
Constructs a BetaSymmetricalDist object with parameters α = β = alpha, over the unit interval (0, 1).
```BetaSymmetricalDist(double alpha, int d)```
Same as BetaSymmetricalDist (alpha), but using approximations of roughly d decimal digits of precision when computing the distribution, complementary distribution, and inverse functions.

Method Summary
` double` `barF(double x)`
Returns the complementary distribution function.
`static double` ```barF(double alpha, int d, double x)```
Returns the complementary distribution function.
` double` `cdf(double x)`
Returns the distribution function F(x).
`static double` ```cdf(double alpha, int d, double x)```
Same as `cdf` (alpha, alpha, d, x).
`static double` ```density(double alpha, double x)```
Returns the density evaluated at x.
`static BetaSymmetricalDist` ```getInstanceFromMLE(double[] x, int n)```
Creates a new instance of a symmetrical beta distribution with parameter α estimated using the maximum likelihood method based on the n observations x[i], i = 0, 1,…, n - 1.
` double` `getMean()`
Returns the mean.
`static double` `getMean(double alpha)`
Computes and returns the mean E[X] = 1/2 of the symmetrical beta distribution with parameter α.
`static double[]` ```getMLE(double[] x, int n)```
Estimates the parameter α of the symmetrical beta distribution over the interval [0, 1] using the maximum likelihood method, from the n observations x[i], i = 0, 1,…, n - 1.
` double[]` `getParams()`
Return a table containing the parameter of the current distribution.
` double` `getStandardDeviation()`
Returns the standard deviation.
`static double` `getStandardDeviation(double alpha)`
Computes and returns the standard deviation of the symmetrical beta distribution with parameter α.
` double` `getVariance()`
Returns the variance.
`static double` `getVariance(double alpha)`
Computes and returns the variance, Var[X] = 1/(8α + 4), of the symmetrical beta distribution with parameter α.
` double` `inverseF(double u)`
Returns the inverse distribution function x = F-1(u).
`static double` ```inverseF(double alpha, double u)```
Returns the inverse distribution function evaluated at u, for the symmetrical beta distribution over the interval [0, 1], with shape parameters 0 < α = β = alpha.
` void` ```setParams(double alpha, double beta, double a, double b, int d)```

` String` `toString()`

`barF, barF, barF, barF, cdf, cdf, cdf, cdf, density, density, density, getA, getAlpha, getB, getBeta, getMean, getMean, getStandardDeviation, getStandardDeviation, getVariance, getVariance, inverseF, inverseF, inverseF, inverseF, setParams`

Methods inherited from class umontreal.iro.lecuyer.probdist.ContinuousDistribution
`getXinf, getXsup, inverseBisection, inverseBrent, setXinf, setXsup`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

BetaSymmetricalDist

`public BetaSymmetricalDist(double alpha)`
Constructs a BetaSymmetricalDist object with parameters α = β = alpha, over the unit interval (0, 1).

BetaSymmetricalDist

```public BetaSymmetricalDist(double alpha,
int d)```
Same as BetaSymmetricalDist (alpha), but using approximations of roughly d decimal digits of precision when computing the distribution, complementary distribution, and inverse functions.

Method Detail

cdf

`public double cdf(double x)`
Description copied from interface: `Distribution`
Returns the distribution function F(x).

Specified by:
`cdf` in interface `Distribution`
Overrides:
`cdf` in class `BetaDist`
Parameters:
`x` - value at which the distribution function is evaluated
Returns:
distribution function evaluated at x

barF

`public double barF(double x)`
Description copied from class: `ContinuousDistribution`
Returns the complementary distribution function. The default implementation computes bar(F)(x) = 1 - F(x).

Specified by:
`barF` in interface `Distribution`
Overrides:
`barF` in class `BetaDist`
Parameters:
`x` - value at which the complementary distribution function is evaluated
Returns:
complementary distribution function evaluated at x

inverseF

`public double inverseF(double u)`
Description copied from class: `ContinuousDistribution`
Returns the inverse distribution function x = F-1(u). Restrictions: u∈[0, 1].

Specified by:
`inverseF` in interface `Distribution`
Overrides:
`inverseF` in class `BetaDist`
Parameters:
`u` - value at which the inverse distribution function is evaluated
Returns:
the inverse distribution function evaluated at u

density

```public static double density(double alpha,
double x)```
Returns the density evaluated at x.

cdf

```public static double cdf(double alpha,
int d,
double x)```
Same as `cdf` (alpha, alpha, d, x).

barF

```public static double barF(double alpha,
int d,
double x)```
Returns the complementary distribution function.

inverseF

```public static double inverseF(double alpha,
double u)```
Returns the inverse distribution function evaluated at u, for the symmetrical beta distribution over the interval [0, 1], with shape parameters 0 < α = β = alpha. Uses four different hypergeometric series to compute the distribution u = F(x) (for the four cases x close to 0 and α < 1, x close to 0 and α > 1, x close to 1/2 and α < 1, and x close to 1/2 and α > 1), which are then solved by Newton's method for the solution of equations. For α > 100000, uses a normal approximation given in.

getMean

`public double getMean()`
Description copied from class: `ContinuousDistribution`
Returns the mean.

Specified by:
`getMean` in interface `Distribution`
Overrides:
`getMean` in class `BetaDist`
Returns:
the mean

getVariance

`public double getVariance()`
Description copied from class: `ContinuousDistribution`
Returns the variance.

Specified by:
`getVariance` in interface `Distribution`
Overrides:
`getVariance` in class `BetaDist`
Returns:
the variance

getStandardDeviation

`public double getStandardDeviation()`
Description copied from class: `ContinuousDistribution`
Returns the standard deviation.

Specified by:
`getStandardDeviation` in interface `Distribution`
Overrides:
`getStandardDeviation` in class `BetaDist`
Returns:
the standard deviation

getMLE

```public static double[] getMLE(double[] x,
int n)```
Estimates the parameter α of the symmetrical beta distribution over the interval [0, 1] using the maximum likelihood method, from the n observations x[i], i = 0, 1,…, n - 1. The estimate is returned in element 0 of the returned array.

Parameters:
`x` - the list of observations to use to evaluate parameters
`n` - the number of observations to use to evaluate parameters
Returns:
returns the parameter [ hat(α)]

getInstanceFromMLE

```public static BetaSymmetricalDist getInstanceFromMLE(double[] x,
int n)```
Creates a new instance of a symmetrical beta distribution with parameter α estimated using the maximum likelihood method based on the n observations x[i], i = 0, 1,…, n - 1.

Parameters:
`x` - the list of observations to use to evaluate parameters
`n` - the number of observations to use to evaluate parameters

getMean

`public static double getMean(double alpha)`
Computes and returns the mean E[X] = 1/2 of the symmetrical beta distribution with parameter α.

Returns:
the mean of the symmetrical beta distribution E[X] = 1/2

getVariance

`public static double getVariance(double alpha)`
Computes and returns the variance, Var[X] = 1/(8α + 4), of the symmetrical beta distribution with parameter α.

Returns:
the variance of the symmetrical beta distribution Var[X] = 1/[4(2α + 1)]

getStandardDeviation

`public static double getStandardDeviation(double alpha)`
Computes and returns the standard deviation of the symmetrical beta distribution with parameter α.

Returns:
the standard deviation of the symmetrical beta distribution

setParams

```public void setParams(double alpha,
double beta,
double a,
double b,
int d)```
Overrides:
`setParams` in class `BetaDist`

getParams

`public double[] getParams()`
Return a table containing the parameter of the current distribution.

Specified by:
`getParams` in interface `Distribution`
Overrides:
`getParams` in class `BetaDist`

toString

`public String toString()`
Overrides:
`toString` in class `BetaDist`

SSJ
V. 2.6.

To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.