Wilks

class Wilks(*args)

Class to estimate a confidence interval on a quantile.

Refer to Estimation of a quantile upper bound by Wilks’ method.

Parameters:
XRandomVector,

A random vector of dimension 1.

Methods

ComputeSampleSize(quantileLevel, confidenceLevel)

Evaluate the minimum size of the sample.

computeQuantileBound(quantileLevel, ...[, ...])

Evaluate an upper bound of a quantile.

Notes

This static class estimates an upper bound of the quantile of level \alpha \in [0,1] of the random variable X with a confidence greater than \beta, using a given order statistics.

Let x_{\alpha} be the unknown quantile of level \alpha of the random variable X of dimension 1. Let (X_1, \dots, X_\sampleSize) be a sample of independent and identically distributed variables according to X. Let X_{(k)} be the k -th order statistics of (X_1, \dots, X_\sampleSize) which means that X_{(k)} is the k -th maximum of (X_1, \dots, X_\sampleSize) for 1 \leq k \leq \sampleSize. For example, X_{(1)} = \min (X_1, \dots, X_\sampleSize) is the minimum and X_{(\sampleSize)} = \max (X_1, \dots, X_\sampleSize) is the maximum. We have:

X_{(1)} \leq X_{(2)} \leq \dots \leq X_{(\sampleSize)}

Given \alpha, \beta and i, the class estimates the minimal size \sampleSize such that:

\Prob{x_{\alpha} \leq X_{(\sampleSize-i)}} \geq \beta

Once the minimal size \sampleSize has been estimated, a sample of size \sampleSize can be generated from X and an upper bound of x_{\alpha} is estimated by the value of the X_{(\sampleSize-i)} on the sample.

__init__(*args)
static ComputeSampleSize(quantileLevel, confidenceLevel, marginIndex=0)

Evaluate the minimum size of the sample.

Parameters:
alphapositive float in [0,1)

The level \alpha of the quantile.

betapositive float in [0,1),

The confidence level on the upper bound.

iint

The index such that X_{(\sampleSize -i)} is an upper bound of x_{\alpha} with confidence \beta. Default value is i = 0.

Returns:
nint,

The minimum size of the sample.

Notes

The minimum sample size \sampleSize is such that:

\Prob{x_{\alpha} \leq X_{(\sampleSize-i)}} \geq \beta

computeQuantileBound(quantileLevel, confidenceLevel, marginIndex=0)

Evaluate an upper bound of a quantile.

Parameters:
alphapositive float in [0,1)

The level \alpha of the quantile.

betapositive float in [0,1)

The confidence level on the upper bound.

iint

The index such that X_{(\sampleSize -i)} is an upper bound of x_{\alpha} with confidence level \beta. Default value is i = 0.

Returns:
upperBoundPoint

The estimate of the quantile upper bound.

Notes

The method starts by evaluating the minimum sample size \sampleSize such that:

\Prob{x_{\alpha} \leq X_{(\sampleSize-i)}} \geq \beta

Then, it generates a sample of size \sampleSize from the random vector X. The upper bound of x_{\alpha} is x_{(\sampleSize-i)}, that is, the \sampleSize - i-th observation in the ordered sample.

Examples using the class

Estimate a confidence interval of a quantile

Estimate a confidence interval of a quantile