SSJ  3.3.1
Stochastic Simulation in Java
Classes | Public Member Functions | Static Public Member Functions | List of all members
BetaSymmetricalDist Class Reference

Specializes the class BetaDist to the case of a symmetrical beta distribution over the interval \([0,1]\), with shape parameters \(\alpha= \beta\). More...

Inheritance diagram for BetaSymmetricalDist:
[legend]
Collaboration diagram for BetaSymmetricalDist:
[legend]

Public Member Functions

 BetaSymmetricalDist (double alpha)
 Constructs a BetaSymmetricalDist object with parameters \(\alpha= \beta=\) 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.
 
double cdf (double x)
 Returns the distribution function \(F(x)\). More...
 
double barF (double x)
 Returns \(\bar{F}(x) = 1 - F(x)\). More...
 
double inverseF (double u)
 Returns the inverse distribution function \(F^{-1}(u)\), defined in ( inverseF ). More...
 
double getMean ()
 Returns the mean of the distribution function.
 
double getVariance ()
 Returns the variance of the distribution function.
 
double getStandardDeviation ()
 Returns the standard deviation of the distribution function.
 
void setParams (double alpha, double beta, double a, double b, int d)
 
double [] getParams ()
 Return a table containing the parameter of the current distribution.
 
String toString ()
 Returns a String containing information about the current distribution.
 
- Public Member Functions inherited from BetaDist
 BetaDist (double alpha, double beta)
 Constructs a BetaDist object with parameters \(\alpha=\) alpha, \(\beta=\) beta and default domain \([0,1]\).
 
 BetaDist (double alpha, double beta, double a, double b)
 Constructs a BetaDist object with parameters \(\alpha=\) alpha, \(\beta=\) beta and domain \([\)a \(,\) b \(]\).
 
 BetaDist (double alpha, double beta, int d)
 
 BetaDist (double alpha, double beta, double a, double b, int d)
 
double density (double x)
 
double cdf (double x)
 Returns the distribution function \(F(x)\). More...
 
double barF (double x)
 Returns \(\bar{F}(x) = 1 - F(x)\). More...
 
double inverseF (double u)
 Returns the inverse distribution function \(F^{-1}(u)\), defined in ( inverseF ). More...
 
double getMean ()
 Returns the mean of the distribution function.
 
double getVariance ()
 Returns the variance of the distribution function.
 
double getStandardDeviation ()
 Returns the standard deviation of the distribution function.
 
double getAlpha ()
 Returns the parameter \(\alpha\) of this object.
 
double getBeta ()
 Returns the parameter \(\beta\) of this object.
 
double getA ()
 Returns the parameter \(a\) of this object.
 
double getB ()
 Returns the parameter \(b\) of this object.
 
void setParams (double alpha, double beta, double a, double b, int d)
 
void setParams (double alpha, double beta, double a, double b)
 Sets the parameters of the current distribution. More...
 
double [] getParams ()
 Return an array containing the parameters of the current distribution as [ \(\alpha\), \(\beta\), \(a\), \(b\)].
 
String toString ()
 Returns a String containing information about the current distribution.
 
- Public Member Functions inherited from ContinuousDistribution
abstract double density (double x)
 Returns \(f(x)\), the density evaluated at \(x\). More...
 
double barF (double x)
 Returns the complementary distribution function. More...
 
double inverseBrent (double a, double b, double u, double tol)
 Computes the inverse distribution function \(x = F^{-1}(u)\), using the Brent-Dekker method. More...
 
double inverseBisection (double u)
 Computes and returns the inverse distribution function \(x = F^{-1}(u)\), using bisection. More...
 
double inverseF (double u)
 Returns the inverse distribution function \(x = F^{-1}(u)\). More...
 
double getMean ()
 Returns the mean. More...
 
double getVariance ()
 Returns the variance. More...
 
double getStandardDeviation ()
 Returns the standard deviation. More...
 
double getXinf ()
 Returns \(x_a\) such that the probability density is 0 everywhere outside the interval \([x_a, x_b]\). More...
 
double getXsup ()
 Returns \(x_b\) such that the probability density is 0 everywhere outside the interval \([x_a, x_b]\). More...
 
void setXinf (double xa)
 Sets the value \(x_a=\) xa, such that the probability density is 0 everywhere outside the interval \([x_a, x_b]\). More...
 
void setXsup (double xb)
 Sets the value \(x_b=\) xb, such that the probability density is 0 everywhere outside the interval \([x_a, x_b]\). More...
 

Static Public Member Functions

static double density (double alpha, double x)
 Returns the density evaluated at \(x\).
 
static double cdf (double alpha, int d, double x)
 Same as cdf(alpha, alpha, d, x).
 
static double barF (double alpha, int d, double x)
 Returns the complementary distribution function.
 
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= \beta\) = alpha. More...
 
static double [] getMLE (double[] x, int n)
 Estimates the parameter \(\alpha\) 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\). More...
 
static BetaSymmetricalDist getInstanceFromMLE (double[] x, int n)
 Creates a new instance of a symmetrical beta distribution with parameter \(\alpha\) estimated using the maximum likelihood method based on the \(n\) observations \(x[i]\), \(i = 0, 1, …, n-1\). More...
 
static double getMean (double alpha)
 Computes and returns the mean \(E[X] = 1/2\) of the symmetrical beta distribution with parameter \(\alpha\). More...
 
static double getVariance (double alpha)
 Computes and returns the variance, \(\mbox{Var}[X] = 1/(8\alpha+ 4)\), of the symmetrical beta distribution with parameter \(\alpha\). More...
 
static double getStandardDeviation (double alpha)
 Computes and returns the standard deviation of the symmetrical beta distribution with parameter \(\alpha\). More...
 
- Static Public Member Functions inherited from BetaDist
static double density (double alpha, double beta, double x)
 Same as density(alpha, beta, 0, 1, x).
 
static double density (double alpha, double beta, double a, double b, double x)
 Computes the density function of the beta distribution.
 
static double cdf (double alpha, double beta, int d, double x)
 
static double cdf (double alpha, double beta, double a, double b, int d, double x)
 
static double barF (double alpha, double beta, int d, double x)
 
static double barF (double alpha, double beta, double a, double b, int d, double x)
 
static double cdf (double alpha, double beta, double x)
 Same as cdf(alpha, beta, 0, 1, x).
 
static double cdf (double alpha, double beta, double a, double b, double x)
 Computes the distribution function. More...
 
static double barF (double alpha, double beta, double x)
 Same as barF(alpha, beta, 0, 1, x).
 
static double barF (double alpha, double beta, double a, double b, double x)
 Computes the complementary distribution function.
 
static double inverseF (double alpha, double beta, int d, double u)
 
static double inverseF (double alpha, double beta, double u)
 Same as inverseF(alpha, beta, 0, 1, u).
 
static double inverseF (double alpha, double beta, double a, double b, int d, double u)
 
static double inverseF (double alpha, double beta, double a, double b, double u)
 Returns the inverse beta distribution function using the algorithm implemented in [183] . More...
 
static double [] getMLE (double[] x, int n)
 Estimates the parameters \((\alpha,\beta)\) of the beta distribution over the interval \([0,1]\) using the maximum likelihood method, from the \(n\) observations \(x[i]\), \(i = 0, 1,…, n-1\). More...
 
static BetaDist getInstanceFromMLE (double[] x, int n)
 Creates a new instance of a beta distribution with parameters \(\alpha\) and \(\beta\) over the interval \([0,1]\) estimated using the maximum likelihood method based on the \(n\) observations \(x[i]\), \(i = 0, 1, …, n-1\). More...
 
static double getMean (double alpha, double beta)
 Computes and returns the mean \(E[X] = \alpha/ (\alpha+ \beta)\) of the beta distribution with parameters \(\alpha\) and \(\beta\), over the interval \([0, 1]\). More...
 
static double getMean (double alpha, double beta, double a, double b)
 Computes and returns the mean \(E[X] = (b\alpha+ a\beta)/ (\alpha+ \beta)\) of the beta distribution with parameters \(\alpha\) and \(\beta\) over the interval \([a, b]\). More...
 
static double getVariance (double alpha, double beta)
 Computes and returns the variance \(\mbox{Var}[X] = \frac{\alpha\beta}{(\alpha+ \beta)^2 (\alpha+ \beta+ 1)}\) of the beta distribution with parameters \(\alpha\) and \(\beta\), over the interval \([0, 1]\). More...
 
static double getVariance (double alpha, double beta, double a, double b)
 Computes and returns the variance \(\mbox{Var}[X] = \frac{\alpha\beta(b-a)^2}{(\alpha+ \beta)^2 (\alpha+ \beta+ 1)}\) of the beta distribution with parameters \(\alpha\) and \(\beta\), over the interval \([a, b]\). More...
 
static double getStandardDeviation (double alpha, double beta)
 Computes the standard deviation of the beta distribution with parameters \(\alpha\) and \(\beta\), over the interval \([0, 1]\). More...
 
static double getStandardDeviation (double alpha, double beta, double a, double b)
 Computes the standard deviation of the beta distribution with parameters \(\alpha\) and \(\beta\), over the interval \([a, b]\). More...
 

Additional Inherited Members

- Public Attributes inherited from ContinuousDistribution
int decPrec = 15
 
- Protected Attributes inherited from BetaDist
double alpha
 
double beta
 
double a
 
double bminusa
 
double logFactor
 
double Beta
 
double logBeta
 
- Protected Attributes inherited from ContinuousDistribution
double supportA = Double.NEGATIVE_INFINITY
 
double supportB = Double.POSITIVE_INFINITY
 
- Static Protected Attributes inherited from ContinuousDistribution
static final double XBIG = 100.0
 
static final double XBIGM = 1000.0
 
static final double [] EPSARRAY
 
- Static Package Functions inherited from BetaDist
static double beta_g (double x)
 
- Package Attributes inherited from BetaDist
double b
 

Detailed Description

Specializes the class BetaDist to the case of a symmetrical beta distribution over the interval \([0,1]\), with shape parameters \(\alpha= \beta\).

Faster methods are implemented here for this special case [134] . 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\).

Member Function Documentation

◆ barF()

double barF ( double  x)

Returns \(\bar{F}(x) = 1 - F(x)\).

Parameters
xvalue at which the complementary distribution function is evaluated
Returns
complementary distribution function evaluated at x

Implements Distribution.

◆ cdf()

double cdf ( double  x)

Returns the distribution function \(F(x)\).

Parameters
xvalue at which the distribution function is evaluated
Returns
distribution function evaluated at x

Implements Distribution.

◆ getInstanceFromMLE()

static BetaSymmetricalDist getInstanceFromMLE ( double []  x,
int  n 
)
static

Creates a new instance of a symmetrical beta distribution with parameter \(\alpha\) estimated using the maximum likelihood method based on the \(n\) observations \(x[i]\), \(i = 0, 1, …, n-1\).

Parameters
xthe list of observations to use to evaluate parameters
nthe number of observations to use to evaluate parameters

◆ getMean()

static double getMean ( double  alpha)
static

Computes and returns the mean \(E[X] = 1/2\) of the symmetrical beta distribution with parameter \(\alpha\).

Returns
the mean of the symmetrical beta distribution \(E[X] = 1/2\)

◆ getMLE()

static double [] getMLE ( double []  x,
int  n 
)
static

Estimates the parameter \(\alpha\) 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. The maximum likelihood estimator \(\hat{\alpha}\) satisfies the equation

\begin{align*} \psi(\hat{\alpha}) - \psi(2\hat{\alpha}) = \frac{1}{2n} \sum_{i=1}^n \ln(x_i(1 - x_i)) \end{align*}

where \(\bar{x}_n\) is the average of \(x[0], …, x[n-1]\), and \(\psi\) is the logarithmic derivative of the Gamma function \(\psi(x) = \Gamma’(x) / \Gamma(x)\).

Parameters
xthe list of observations to use to evaluate parameters
nthe number of observations to use to evaluate parameters
Returns
returns the parameter [ \(\hat{\alpha}\)]

◆ getStandardDeviation()

static double getStandardDeviation ( double  alpha)
static

Computes and returns the standard deviation of the symmetrical beta distribution with parameter \(\alpha\).

Returns
the standard deviation of the symmetrical beta distribution

◆ getVariance()

static double getVariance ( double  alpha)
static

Computes and returns the variance, \(\mbox{Var}[X] = 1/(8\alpha+ 4)\), of the symmetrical beta distribution with parameter \(\alpha\).

Returns
the variance of the symmetrical beta distribution \(\mbox{Var}[X] = 1 / [4 (2\alpha+ 1)]\)

◆ inverseF() [1/2]

double inverseF ( double  u)

Returns the inverse distribution function \(F^{-1}(u)\), defined in ( inverseF ).

Parameters
uvalue in the interval \((0,1)\) for which the inverse distribution function is evaluated
Returns
the inverse distribution function evaluated at u

Implements Distribution.

◆ inverseF() [2/2]

static double inverseF ( double  alpha,
double  u 
)
static

Returns the inverse distribution function evaluated at \(u\), for the symmetrical beta distribution over the interval \([0,1]\), with shape parameters \(0 < \alpha= \beta\) = alpha.

Uses four different hypergeometric series to compute the distribution \(u = F(x)\) (for the four cases \(x\) close to 0 and \(\alpha< 1\), \(x\) close to 0 and \(\alpha> 1\), \(x\) close to 1/2 and \(\alpha< 1\), and \(x\) close to 1/2 and \(\alpha> 1\)), which are then solved by Newton’s method for the solution of equations. For \(\alpha> 100000\), uses a normal approximation given in [201] .


The documentation for this class was generated from the following file: