SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
umontreal.ssj.probdist.BetaDist Class Reference

Extends the class ContinuousDistribution for the beta distribution. More...

Inheritance diagram for umontreal.ssj.probdist.BetaDist:
umontreal.ssj.probdist.ContinuousDistribution umontreal.ssj.probdist.Distribution umontreal.ssj.probdist.BetaSymmetricalDist

Public Member Functions

 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.
double density (double x)
 Returns \(f(x)\), the density evaluated at \(x\).
double cdf (double x)
 Returns the distribution function \(F(x)\).
double barF (double x)
 Returns the complementary distribution function.
double inverseF (double u)
 Returns the inverse distribution function \(x = F^{-1}(u)\).
double getMean ()
 Returns the mean.
double getVariance ()
 Returns the variance.
double getStandardDeviation ()
 Returns the standard deviation.
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)
 Sets the parameters of the current distribution.
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 umontreal.ssj.probdist.ContinuousDistribution
double inverseBrent (double a, double b, double u, double tol)
 Computes the inverse distribution function \(x = F^{-1}(u)\), using the Brent-Dekker method.
double inverseBisection (double u)
 Computes and returns the inverse distribution function \(x = F^{-1}(u)\), using bisection.
double getXinf ()
 Returns \(x_a\) such that the probability density is 0 everywhere outside the interval \([x_a, x_b]\).
double getXsup ()
 Returns \(x_b\) such that the probability density is 0 everywhere outside the interval \([x_a, x_b]\).
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]\).
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]\).

Static Public Member Functions

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, 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.
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, double u)
 Same as inverseF(alpha, beta, 0, 1, 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 [178] .
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\).
static BetaDist getInstanceFromMLE (double[] x, int n)
 Creates a new instance of a beta distribution with parameters.
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]\).
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.
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.
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.
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]\).
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]\).

Detailed Description

Extends the class ContinuousDistribution for the beta distribution.

[96]  (page 210) with shape parameters \(\alpha> 0\) and \(\beta> 0\), over the interval \([a,b]\), where \(a < b\). This distribution has density

\[ f(x) = \frac{ (x-a)^{\alpha- 1}(b - x)^{\beta- 1}}{\mathcal{B} (\alpha, \beta)(b - a)^{\alpha+ \beta- 1}}, \qquad\mbox{for } a\le x\le b, \mbox{ and }0\mbox{ elsewhere}, \]

and distribution function

\[ F(x) = I_{\alpha,\beta}(x) = \int_a^x \frac{(\xi- a)^{\alpha-1} (b - \xi)^{\beta-1}}{\mathcal{B} (\alpha, \beta)(b - a)^{\alpha+ \beta- 1}} d\xi, \qquad\mbox{for } a\le x\le b, \tag{Fbeta} \]

where \(\mathcal{B}(\alpha,\beta)\) is the beta function defined by

\[ \mathcal{B} (\alpha,\beta) = \frac{\Gamma(\alpha) \Gamma(\beta)}{ \Gamma(\alpha+\beta)},\tag{betadef} \]

and \(\Gamma(x)\) is the gamma function defined in ( Gamma ).

Definition at line 54 of file BetaDist.java.

Constructor & Destructor Documentation

◆ BetaDist() [1/2]

umontreal.ssj.probdist.BetaDist.BetaDist ( double alpha,
double beta )

Constructs a BetaDist object with parameters \(\alpha=\) alpha, \(\beta=\) beta and default domain \([0,1]\).

Definition at line 104 of file BetaDist.java.

◆ BetaDist() [2/2]

umontreal.ssj.probdist.BetaDist.BetaDist ( double alpha,
double beta,
double a,
double b )

Constructs a BetaDist object with parameters \(\alpha=\) alpha, \(\beta=\) beta and domain.

\([\)a \(,\) b \(]\).

Definition at line 114 of file BetaDist.java.

Member Function Documentation

◆ barF() [1/3]

double umontreal.ssj.probdist.BetaDist.barF ( double alpha,
double beta,
double a,
double b,
double x )
static

Computes the complementary distribution function.

Definition at line 368 of file BetaDist.java.

◆ barF() [2/3]

double umontreal.ssj.probdist.BetaDist.barF ( double alpha,
double beta,
double x )
static

Same as barF(alpha, beta, 0, 1, x).

Definition at line 361 of file BetaDist.java.

◆ barF() [3/3]

double umontreal.ssj.probdist.BetaDist.barF ( double x)

Returns the complementary distribution function.

The default implementation computes \(\bar{F}(x) = 1 - F(x)\).

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

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Reimplemented in umontreal.ssj.probdist.BetaSymmetricalDist.

Definition at line 132 of file BetaDist.java.

◆ cdf() [1/3]

double umontreal.ssj.probdist.BetaDist.cdf ( double alpha,
double beta,
double a,
double b,
double x )
static

Computes the distribution function.

If \(\max(\alpha, \beta) \le10^4\), uses a continuous fraction in \(\alpha\) and

\(\beta\) given in [51], [38] . Otherwise, if \(\min(\alpha, \beta) \le30\), uses an approximation due to Bol’shev [168] , else uses a normal approximation [195] .

Definition at line 353 of file BetaDist.java.

◆ cdf() [2/3]

double umontreal.ssj.probdist.BetaDist.cdf ( double alpha,
double beta,
double x )
static

Same as cdf(alpha, beta, 0, 1, x).

Definition at line 317 of file BetaDist.java.

◆ cdf() [3/3]

double umontreal.ssj.probdist.BetaDist.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 umontreal.ssj.probdist.Distribution.

Reimplemented in umontreal.ssj.probdist.BetaSymmetricalDist.

Definition at line 127 of file BetaDist.java.

◆ density() [1/3]

double umontreal.ssj.probdist.BetaDist.density ( double alpha,
double beta,
double a,
double b,
double x )
static

Computes the density function of the beta distribution.

Definition at line 167 of file BetaDist.java.

◆ density() [2/3]

double umontreal.ssj.probdist.BetaDist.density ( double alpha,
double beta,
double x )
static

Same as density(alpha, beta, 0, 1, x).

Definition at line 160 of file BetaDist.java.

◆ density() [3/3]

double umontreal.ssj.probdist.BetaDist.density ( double x)

Returns \(f(x)\), the density evaluated at \(x\).

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

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 119 of file BetaDist.java.

◆ getA()

double umontreal.ssj.probdist.BetaDist.getA ( )

Returns the parameter \(a\) of this object.

Definition at line 818 of file BetaDist.java.

◆ getAlpha()

double umontreal.ssj.probdist.BetaDist.getAlpha ( )

Returns the parameter \(\alpha\) of this object.

Definition at line 804 of file BetaDist.java.

◆ getB()

double umontreal.ssj.probdist.BetaDist.getB ( )

Returns the parameter \(b\) of this object.

Definition at line 825 of file BetaDist.java.

◆ getBeta()

double umontreal.ssj.probdist.BetaDist.getBeta ( )

Returns the parameter \(\beta\) of this object.

Definition at line 811 of file BetaDist.java.

◆ getInstanceFromMLE()

BetaDist umontreal.ssj.probdist.BetaDist.getInstanceFromMLE ( double[] x,
int n )
static

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\).

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

Reimplemented in umontreal.ssj.probdist.BetaSymmetricalDist.

Definition at line 718 of file BetaDist.java.

◆ getMean() [1/3]

double umontreal.ssj.probdist.BetaDist.getMean ( )

Returns the mean.

Returns
the mean

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Reimplemented in umontreal.ssj.probdist.BetaSymmetricalDist.

Definition at line 142 of file BetaDist.java.

◆ getMean() [2/3]

double umontreal.ssj.probdist.BetaDist.getMean ( double alpha,
double beta )
static

Computes and returns the mean \(E[X] = \alpha/ (\alpha+ \beta)\) of the beta distribution with parameters \(\alpha\) and \(\beta\), over the interval \([0, 1]\).

Returns
the mean of the Beta distribution

Definition at line 730 of file BetaDist.java.

◆ getMean() [3/3]

double umontreal.ssj.probdist.BetaDist.getMean ( double alpha,
double beta,
double a,
double b )
static

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]\).

Returns
the mean of the Beta distribution

Definition at line 741 of file BetaDist.java.

◆ getMLE()

double[] umontreal.ssj.probdist.BetaDist.getMLE ( double[] x,
int n )
static

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\).

The estimates are returned in a two-element array, in regular order: [ \(\alpha\), \(\beta\)]. The maximum likelihood estimators are the values \((\hat{\alpha}, \hat{\beta})\) that satisfy the equations:

\begin{align*} \psi(\alpha) - \psi(\alpha+ \beta) & = \frac{1}{n} \sum_{i=1}^n \ln(x_i) \\ \psi(\beta) - \psi(\alpha+ \beta) & = \frac{1}{n} \sum_{i=1}^n \ln(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 parameters [ \(\hat{\alpha}\), \(\hat{\beta}\)]

Reimplemented in umontreal.ssj.probdist.BetaSymmetricalDist.

Definition at line 665 of file BetaDist.java.

◆ getParams()

double[] umontreal.ssj.probdist.BetaDist.getParams ( )

Return an array containing the parameters of the current distribution as [ \(\alpha\), \(\beta\), \(a\), \(b\)].

Implements umontreal.ssj.probdist.Distribution.

Reimplemented in umontreal.ssj.probdist.BetaSymmetricalDist.

Definition at line 859 of file BetaDist.java.

◆ getStandardDeviation() [1/3]

double umontreal.ssj.probdist.BetaDist.getStandardDeviation ( )

Returns the standard deviation.

Returns
the standard deviation

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Reimplemented in umontreal.ssj.probdist.BetaSymmetricalDist.

Definition at line 152 of file BetaDist.java.

◆ getStandardDeviation() [2/3]

double umontreal.ssj.probdist.BetaDist.getStandardDeviation ( double alpha,
double beta )
static

Computes the standard deviation of the beta distribution with parameters \(\alpha\) and \(\beta\), over the interval \([0, 1]\).

Returns
the standard deviation of the Beta distribution

Definition at line 787 of file BetaDist.java.

◆ getStandardDeviation() [3/3]

double umontreal.ssj.probdist.BetaDist.getStandardDeviation ( double alpha,
double beta,
double a,
double b )
static

Computes the standard deviation of the beta distribution with parameters \(\alpha\) and \(\beta\), over the interval \([a, b]\).

Returns
the standard deviation of the Beta distribution

Definition at line 797 of file BetaDist.java.

◆ getVariance() [1/3]

double umontreal.ssj.probdist.BetaDist.getVariance ( )

Returns the variance.

Returns
the variance

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Reimplemented in umontreal.ssj.probdist.BetaSymmetricalDist.

Definition at line 147 of file BetaDist.java.

◆ getVariance() [2/3]

double umontreal.ssj.probdist.BetaDist.getVariance ( double alpha,
double beta )
static

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]\).

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

Definition at line 759 of file BetaDist.java.

◆ getVariance() [3/3]

double umontreal.ssj.probdist.BetaDist.getVariance ( double alpha,
double beta,
double a,
double b )
static

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]\).

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

Definition at line 772 of file BetaDist.java.

◆ inverseF() [1/3]

double umontreal.ssj.probdist.BetaDist.inverseF ( double alpha,
double beta,
double a,
double b,
double u )
static

Returns the inverse beta distribution function using the algorithm implemented in [178] .

The method performs interval halving or Newton iterations to compute the inverse.

Definition at line 640 of file BetaDist.java.

◆ inverseF() [2/3]

double umontreal.ssj.probdist.BetaDist.inverseF ( double alpha,
double beta,
double u )
static

Same as inverseF(alpha, beta, 0, 1, u).

Definition at line 624 of file BetaDist.java.

◆ inverseF() [3/3]

double umontreal.ssj.probdist.BetaDist.inverseF ( double u)

Returns the inverse distribution function \(x = F^{-1}(u)\).

Restrictions: \(u \in[0,1]\).

Parameters
uvalue at which the inverse distribution function is evaluated
Returns
the inverse distribution function evaluated at u
Exceptions
IllegalArgumentExceptionif \(u\) is not in the interval \([0,1]\)

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Reimplemented in umontreal.ssj.probdist.BetaSymmetricalDist.

Definition at line 137 of file BetaDist.java.

◆ setParams()

void umontreal.ssj.probdist.BetaDist.setParams ( double alpha,
double beta,
double a,
double b )

Sets the parameters of the current distribution.

See the constructor.

Definition at line 832 of file BetaDist.java.

◆ toString()

String umontreal.ssj.probdist.BetaDist.toString ( )

Returns a String containing information about the current distribution.

Reimplemented in umontreal.ssj.probdist.BetaSymmetricalDist.

Definition at line 868 of file BetaDist.java.


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