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

Extends the class ContinuousDistribution for the Anderson–Darling distribution (see [6], [161], [169],. More...

Inheritance diagram for umontreal.ssj.probdist.AndersonDarlingDist:
umontreal.ssj.probdist.ContinuousDistribution umontreal.ssj.probdist.Distribution umontreal.ssj.probdist.AndersonDarlingDistQuick

Public Member Functions

 AndersonDarlingDist (int n)
 Constructs an Anderson–Darling distribution for a sample of size \(n\).
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)\).
int getN ()
 Returns the parameter \(n\) of this object.
void setN (int n)
 Sets the parameter \(n\) of this object.
double[] getParams ()
 Return an array containing the parameter \(n\) of the current distribution.
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 getMean ()
 Returns the mean.
double getVariance ()
 Returns the variance.
double getStandardDeviation ()
 Returns the standard deviation.
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 (int n, double x)
 Computes the density of the Anderson–Darling distribution with parameter \(n\).
static double cdf (int n, double x)
 Computes the Anderson–Darling distribution function \(F_n(x)\), with parameter \(n\), using Marsaglia’s and al.
static double barF (int n, double x)
 Computes the complementary distribution function \(\bar{F}_n(x)\) with parameter \(n\).
static double inverseF (int n, double u)
 Computes the inverse \(x = F_n^{-1}(u)\) of the Anderson–Darling distribution with parameter \(n\).

Detailed Description

Extends the class ContinuousDistribution for the Anderson–Darling distribution (see [6], [161], [169],.

[216] ). Given a sample of \(n\) independent uniforms \(U_i\) over \((0,1)\), the Anderson–Darling statistic \(A_n^2\) is defined by

\begin{align*} A_n^2 & = -n -\frac{1}{n} \sum_{j=1}^n \left\{ (2j-1)\ln(U_{(j)}) + (2n+1-2j) \ln(1-U_{(j)}) \right\}, \tag{Andar} \end{align*}

where the \(U_{(j)}\) are the \(U_i\) sorted in increasing order. The distribution function (the cumulative probabilities) is defined as \(F_n(x) = P[A_n^2 \le x]\).

Definition at line 48 of file AndersonDarlingDist.java.

Constructor & Destructor Documentation

◆ AndersonDarlingDist()

umontreal.ssj.probdist.AndersonDarlingDist.AndersonDarlingDist ( int n)

Constructs an Anderson–Darling distribution for a sample of size \(n\).

Definition at line 68 of file AndersonDarlingDist.java.

Member Function Documentation

◆ barF() [1/2]

double umontreal.ssj.probdist.AndersonDarlingDist.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.AndersonDarlingDistQuick.

Definition at line 80 of file AndersonDarlingDist.java.

◆ barF() [2/2]

double umontreal.ssj.probdist.AndersonDarlingDist.barF ( int n,
double x )
static

Computes the complementary distribution function \(\bar{F}_n(x)\) with parameter \(n\).

Reimplemented in umontreal.ssj.probdist.AndersonDarlingDistQuick.

Definition at line 257 of file AndersonDarlingDist.java.

◆ cdf() [1/2]

double umontreal.ssj.probdist.AndersonDarlingDist.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.AndersonDarlingDistQuick.

Definition at line 76 of file AndersonDarlingDist.java.

◆ cdf() [2/2]

double umontreal.ssj.probdist.AndersonDarlingDist.cdf ( int n,
double x )
static

Computes the Anderson–Darling distribution function \(F_n(x)\), with parameter \(n\), using Marsaglia’s and al.

algorithm

[169] . First the asymptotic distribution for \(n\to\infty\) is computed. Then an empirical correction obtained by simulation is added for finite \(n\).

Reimplemented in umontreal.ssj.probdist.AndersonDarlingDistQuick.

Definition at line 223 of file AndersonDarlingDist.java.

◆ density() [1/2]

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

Reimplemented in umontreal.ssj.probdist.AndersonDarlingDistQuick.

Definition at line 72 of file AndersonDarlingDist.java.

◆ density() [2/2]

double umontreal.ssj.probdist.AndersonDarlingDist.density ( int n,
double x )
static

Computes the density of the Anderson–Darling distribution with parameter \(n\).

Reimplemented in umontreal.ssj.probdist.AndersonDarlingDistQuick.

Definition at line 106 of file AndersonDarlingDist.java.

◆ getN()

int umontreal.ssj.probdist.AndersonDarlingDist.getN ( )

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

Definition at line 297 of file AndersonDarlingDist.java.

◆ getParams()

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

Return an array containing the parameter \(n\) of the current distribution.

Implements umontreal.ssj.probdist.Distribution.

Definition at line 320 of file AndersonDarlingDist.java.

◆ inverseF() [1/2]

double umontreal.ssj.probdist.AndersonDarlingDist.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.AndersonDarlingDistQuick.

Definition at line 84 of file AndersonDarlingDist.java.

◆ inverseF() [2/2]

double umontreal.ssj.probdist.AndersonDarlingDist.inverseF ( int n,
double u )
static

Computes the inverse \(x = F_n^{-1}(u)\) of the Anderson–Darling distribution with parameter \(n\).

Reimplemented in umontreal.ssj.probdist.AndersonDarlingDistQuick.

Definition at line 279 of file AndersonDarlingDist.java.

◆ setN()

void umontreal.ssj.probdist.AndersonDarlingDist.setN ( int n)

Sets the parameter \(n\) of this object.

Definition at line 304 of file AndersonDarlingDist.java.

◆ toString()

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

Returns a String containing information about the current distribution.

Reimplemented in umontreal.ssj.probdist.AndersonDarlingDistQuick.

Definition at line 328 of file AndersonDarlingDist.java.


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