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

Extends the class ContinuousDistribution for the Watson U distribution (see [54], [215], [216] ). More...

Inheritance diagram for umontreal.ssj.probdist.WatsonUDist:
umontreal.ssj.probdist.ContinuousDistribution umontreal.ssj.probdist.Distribution

Public Member Functions

 WatsonUDist (int n)
 Constructs a Watson U 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)\).
double getMean ()
 Returns the mean.
double getVariance ()
 Returns the variance.
double getStandardDeviation ()
 Returns the standard deviation.
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 this object.
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 (int n, double x)
 Computes the density of the Watson U distribution with parameter \(n\).
static double cdf (int n, double x)
 Computes the Watson \(U\) distribution function, i.e.
static double barF (int n, double x)
 Computes the complementary distribution function \(\bar{F}_n(x)\), where \(F_n\) is the Watson \(U\) distribution with parameter \(n\).
static double inverseF (int n, double u)
 Computes \(x = F_n^{-1}(u)\), where \(F_n\) is the Watson.
static double getMean (int n)
 Returns the mean of the Watson \(U\) distribution with parameter.
static double getVariance (int n)
 Returns the variance of the Watson \(U\) distribution with parameter \(n\).
static double getStandardDeviation (int n)
 Returns the standard deviation of the Watson \(U\) distribution with parameter \(n\).

Detailed Description

Extends the class ContinuousDistribution for the Watson U distribution (see [54], [215], [216] ).

Given a sample of \(n\) independent uniforms \(u_i\) over \([0,1]\), the Watson statistic \(U_n^2\) is defined by

\begin{align*} W_n^2 & = \frac{1}{12n} + \sum_{j=1}^n \left\{u_{(j)} - \frac{(j- 1/2)}{n}\right\}^2, \\ U_n^2 & = W_n^2 - n\left(\bar{u}_n - 1/2\right)^2. \tag{WatsonU} \end{align*}

where the \(u_{(j)}\) are the \(u_i\) sorted in increasing order, and \(\bar{u}_n\) is the average of the observations \(u_i\). The distribution function (the cumulative probabilities) is defined as \(F_n(x) = P[U_n^2 \le x]\).

Definition at line 49 of file WatsonUDist.java.

Constructor & Destructor Documentation

◆ WatsonUDist()

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

Constructs a Watson U distribution for a sample of size \(n\).

Definition at line 95 of file WatsonUDist.java.

Member Function Documentation

◆ barF() [1/2]

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

Definition at line 107 of file WatsonUDist.java.

◆ barF() [2/2]

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

Computes the complementary distribution function \(\bar{F}_n(x)\), where \(F_n\) is the Watson \(U\) distribution with parameter \(n\).

Definition at line 215 of file WatsonUDist.java.

◆ cdf() [1/2]

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

Definition at line 103 of file WatsonUDist.java.

◆ cdf() [2/2]

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

Computes the Watson \(U\) distribution function, i.e.

returns \(P[U_n^2 \le x]\), where \(U_n^2\) is the Watson statistic defined in ( WatsonU ). We use the asymptotic distribution for \(n \to\infty\), plus a correction in \(O(1/n)\), as given in [37] .

Definition at line 168 of file WatsonUDist.java.

◆ density() [1/2]

double umontreal.ssj.probdist.WatsonUDist.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 99 of file WatsonUDist.java.

◆ density() [2/2]

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

Computes the density of the Watson U distribution with parameter \(n\).

Definition at line 130 of file WatsonUDist.java.

◆ getMean() [1/2]

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

Returns the mean.

Returns
the mean

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 115 of file WatsonUDist.java.

◆ getMean() [2/2]

double umontreal.ssj.probdist.WatsonUDist.getMean ( int n)
static

Returns the mean of the Watson \(U\) distribution with parameter.

\(n\).

Returns
Returns the mean

Definition at line 285 of file WatsonUDist.java.

◆ getN()

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

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

Definition at line 312 of file WatsonUDist.java.

◆ getParams()

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

Return an array containing the parameter \(n\) of this object.

Implements umontreal.ssj.probdist.Distribution.

Definition at line 330 of file WatsonUDist.java.

◆ getStandardDeviation() [1/2]

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

Returns the standard deviation.

Returns
the standard deviation

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 123 of file WatsonUDist.java.

◆ getStandardDeviation() [2/2]

double umontreal.ssj.probdist.WatsonUDist.getStandardDeviation ( int n)
static

Returns the standard deviation of the Watson \(U\) distribution with parameter \(n\).

Returns
the standard deviation

Definition at line 305 of file WatsonUDist.java.

◆ getVariance() [1/2]

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

Returns the variance.

Returns
the variance

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 119 of file WatsonUDist.java.

◆ getVariance() [2/2]

double umontreal.ssj.probdist.WatsonUDist.getVariance ( int n)
static

Returns the variance of the Watson \(U\) distribution with parameter \(n\).

Returns
the variance

Definition at line 295 of file WatsonUDist.java.

◆ inverseF() [1/2]

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

Definition at line 111 of file WatsonUDist.java.

◆ inverseF() [2/2]

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

Computes \(x = F_n^{-1}(u)\), where \(F_n\) is the Watson.

\(U\) distribution with parameter \(n\).

Definition at line 263 of file WatsonUDist.java.

◆ setN()

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

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

Definition at line 319 of file WatsonUDist.java.

◆ toString()

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

Returns a String containing information about the current distribution.

Definition at line 338 of file WatsonUDist.java.


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