NonCentralChiSquare distribution

(Source code, png)

../../_images/openturns-NonCentralChiSquare-1.png
class NonCentralChiSquare(*args)

NonCentralChiSquare distribution.

Parameters:
nufloat, \nu > 0

Generalised number degree of freedom.

Default value is 5.0.

lambdafloat, \lambda \geq 0

Non-centrality parameter \lambda.

Default value is 0.0.

Notes

Its probability density function is defined as:

f_X(x) = \sum_{j=0}^{\infty} e^{-\lambda}
                             \frac{\lambda^j}{j!}p_{\chi^2(\nu + 2j)}(x),
         \quad x \in [0; +\infty[

where p_{\chi^2(q)} is the probability density function of a \chi^2(q) random variate.

Its first moments are:

\begin{eqnarray*}
    \Expect{X} & = & \nu + \lambda \\
    \Var{X} & = & 2(\nu + 2\lambda)
\end{eqnarray*}

Examples

Create a distribution:

>>> import openturns as ot
>>> distribution = ot.NonCentralChiSquare(6.0)

Draw a sample:

>>> sample = distribution.getSample(5)

Methods

abs()

Transform distribution by absolute value function.

acos()

Transform distribution by arccosine function.

acosh()

Transform distribution by acosh function.

asin()

Transform distribution by arcsine function.

asinh()

Transform distribution by asinh function.

atan()

Transform distribution by arctangent function.

atanh()

Transform distribution by atanh function.

cbrt()

Transform distribution by cubic root function.

computeBilateralConfidenceInterval(prob)

Compute a bilateral confidence interval.

computeBilateralConfidenceIntervalWithMarginalProbability(prob)

Compute a bilateral confidence interval.

computeCDF(*args)

Compute the cumulative distribution function.

computeCDFGradient(*args)

Compute the gradient of the cumulative distribution function.

computeCharacteristicFunction(x)

Compute the characteristic function.

computeComplementaryCDF(*args)

Compute the complementary cumulative distribution function.

computeConditionalCDF(*args)

Compute the conditional cumulative distribution function.

computeConditionalDDF(x, y)

Compute the conditional derivative density function of the last component.

computeConditionalPDF(*args)

Compute the conditional probability density function.

computeConditionalQuantile(*args)

Compute the conditional quantile function of the last component.

computeDDF(*args)

Compute the derivative density function.

computeEntropy()

Compute the entropy of the distribution.

computeGeneratingFunction(*args)

Compute the probability-generating function.

computeInverseSurvivalFunction(point)

Compute the inverse survival function.

computeLogCharacteristicFunction(x)

Compute the logarithm of the characteristic function.

computeLogGeneratingFunction(*args)

Compute the logarithm of the probability-generating function.

computeLogPDF(*args)

Compute the logarithm of the probability density function.

computeLogPDFGradient(*args)

Compute the gradient of the log probability density function.

computeLowerExtremalDependenceMatrix()

Compute the lower extremal dependence coefficients.

computeLowerTailDependenceMatrix()

Compute the lower tail dependence coefficients.

computeMinimumVolumeInterval(prob)

Compute the confidence interval with minimum volume.

computeMinimumVolumeIntervalWithMarginalProbability(prob)

Compute the confidence interval with minimum volume.

computeMinimumVolumeLevelSet(prob)

Compute the confidence domain with minimum volume.

computeMinimumVolumeLevelSetWithThreshold(prob)

Compute the confidence domain with minimum volume.

computePDF(*args)

Compute the probability density function.

computePDFGradient(*args)

Compute the gradient of the probability density function.

computeProbability(interval)

Compute the interval probability.

computeQuantile(*args)

Compute the quantile function.

computeRadialDistributionCDF(radius[, tail])

Compute the cumulative distribution function of the squared radius.

computeScalarQuantile(prob[, tail])

Compute the quantile function for univariate distributions.

computeSequentialConditionalCDF(x)

Compute the sequential conditional cumulative distribution functions.

computeSequentialConditionalDDF(x)

Compute the sequential conditional derivative density function.

computeSequentialConditionalPDF(x)

Compute the sequential conditional probability density function.

computeSequentialConditionalQuantile(q)

Compute the conditional quantile function of the last component.

computeSurvivalFunction(*args)

Compute the survival function.

computeUnilateralConfidenceInterval(prob[, tail])

Compute a unilateral confidence interval.

computeUnilateralConfidenceIntervalWithMarginalProbability(...)

Compute a unilateral confidence interval.

computeUpperExtremalDependenceMatrix()

Compute the upper extremal dependence coefficients.

computeUpperTailDependenceMatrix()

Compute the upper tail dependence coefficients.

cos()

Transform distribution by cosine function.

cosh()

Transform distribution by cosh function.

drawCDF(*args)

Draw the cumulative distribution function.

drawLogPDF(*args)

Draw the graph or of iso-lines of log-probability density function.

drawLowerExtremalDependenceFunction()

Draw the lower extremal dependence function.

drawLowerTailDependenceFunction()

Draw the lower tail dependence function.

drawMarginal1DCDF(marginalIndex, xMin, xMax, ...)

Draw the cumulative distribution function of a margin.

drawMarginal1DLogPDF(marginalIndex, xMin, ...)

Draw the log-probability density function of a margin.

drawMarginal1DPDF(marginalIndex, xMin, xMax, ...)

Draw the probability density function of a margin.

drawMarginal1DSurvivalFunction(...[, logScale])

Draw the cumulative distribution function of a margin.

drawMarginal2DCDF(firstMarginal, ...[, ...])

Draw the cumulative distribution function of a couple of margins.

drawMarginal2DLogPDF(firstMarginal, ...[, ...])

Draw the log-probability density function of a couple of margins.

drawMarginal2DPDF(firstMarginal, ...[, ...])

Draw the probability density function of a couple of margins.

drawMarginal2DSurvivalFunction(...[, ...])

Draw the cumulative distribution function of a couple of margins.

drawPDF(*args)

Draw the graph or of iso-lines of probability density function.

drawQuantile(*args)

Draw the quantile function.

drawSurvivalFunction(*args)

Draw the cumulative distribution function.

drawUpperExtremalDependenceFunction()

Draw the upper extremal dependence function.

drawUpperTailDependenceFunction()

Draw the upper tail dependence function.

exp()

Transform distribution by exponential function.

getCDFEpsilon()

Accessor to the CDF computation precision.

getCentralMoment(n)

Accessor to the componentwise central moments.

getCholesky()

Accessor to the Cholesky factor of the covariance matrix.

getClassName()

Accessor to the object's name.

getCopula()

Accessor to the copula of the distribution.

getCorrelation()

Accessor to the correlation matrix.

getCovariance()

Accessor to the covariance matrix.

getDescription()

Accessor to the componentwise description.

getDimension()

Accessor to the dimension of the distribution.

getDispersionIndicator()

Dispersion indicator accessor.

getId()

Accessor to the object's id.

getIntegrationNodesNumber()

Accessor to the number of Gauss integration points.

getInverseCholesky()

Accessor to the inverse Cholesky factor of the covariance matrix.

getInverseIsoProbabilisticTransformation()

Accessor to the inverse iso-probabilistic transformation.

getIsoProbabilisticTransformation()

Accessor to the iso-probabilistic transformation.

getKendallTau()

Accessor to the Kendall coefficients matrix.

getKurtosis()

Accessor to the componentwise kurtosis.

getLambda()

Accessor to the distribution's non-centrality parameter \lambda.

getMarginal(*args)

Accessor to marginal distributions.

getMaximumIteration()

Accessor to the maximum iteration number for PDF and CDF computation.

getMean()

Accessor to the mean.

getMoment(n)

Accessor to the componentwise moments.

getName()

Accessor to the object's name.

getNu()

Accessor to the distribution's generalised number degrees of freedom.

getPDFEpsilon()

Accessor to the PDF computation precision.

getParameter()

Accessor to the parameter of the distribution.

getParameterDescription()

Accessor to the parameter description of the distribution.

getParameterDimension()

Accessor to the number of parameters in the distribution.

getParametersCollection()

Accessor to the parameter of the distribution.

getPearsonCorrelation()

Accessor to the Pearson correlation matrix.

getPositionIndicator()

Position indicator accessor.

getProbabilities()

Accessor to the discrete probability levels.

getRange()

Accessor to the range of the distribution.

getRealization()

Accessor to a pseudo-random realization from the distribution.

getRoughness()

Accessor to roughness of the distribution.

getSample(size)

Accessor to a pseudo-random sample from the distribution.

getSampleByInversion(size)

Accessor to a pseudo-random sample from the distribution.

getSampleByQMC(size)

Accessor to a low discrepancy sample from the distribution.

getShadowedId()

Accessor to the object's shadowed id.

getShapeMatrix()

Accessor to the shape matrix of the underlying copula if it is elliptical.

getShiftedMoment(n, shift)

Accessor to the componentwise shifted moments.

getSingularities()

Accessor to the singularities of the PDF function.

getSkewness()

Accessor to the componentwise skewness.

getSpearmanCorrelation()

Accessor to the Spearman correlation matrix.

getStandardDeviation()

Accessor to the componentwise standard deviation.

getStandardDistribution()

Accessor to the standard distribution.

getStandardRepresentative()

Accessor to the standard representative distribution in the parametric family.

getSupport(*args)

Accessor to the support of the distribution.

getVisibility()

Accessor to the object's visibility state.

hasEllipticalCopula()

Test whether the copula of the distribution is elliptical or not.

hasIndependentCopula()

Test whether the copula of the distribution is the independent one.

hasName()

Test if the object is named.

hasVisibleName()

Test if the object has a distinguishable name.

inverse()

Transform distribution by inverse function.

isContinuous()

Test whether the distribution is continuous or not.

isCopula()

Test whether the distribution is a copula or not.

isDiscrete()

Test whether the distribution is discrete or not.

isElliptical()

Test whether the distribution is elliptical or not.

isIntegral()

Test whether the distribution is integer-valued or not.

ln()

Transform distribution by natural logarithm function.

log()

Transform distribution by natural logarithm function.

setDescription(description)

Accessor to the componentwise description.

setIntegrationNodesNumber(integrationNodesNumber)

Accessor to the number of Gauss integration points.

setLambda(_lambda)

Accessor to the distribution's non-centrality parameter \lambda.

setMaximumIteration(maximumIteration)

Accessor to the maximum iteration number for PDF and CDF computation.

setName(name)

Accessor to the object's name.

setNu(nu)

Accessor to the distribution's generalised number degrees of freedom.

setNuLambda(nu, _lambda)

Accessor to the distribution's non-centrality parameters.

setParameter(parameter)

Accessor to the parameter of the distribution.

setParametersCollection(*args)

Accessor to the parameter of the distribution.

setShadowedId(id)

Accessor to the object's shadowed id.

setVisibility(visible)

Accessor to the object's visibility state.

sin()

Transform distribution by sine function.

sinh()

Transform distribution by sinh function.

sqr()

Transform distribution by square function.

sqrt()

Transform distribution by square root function.

tan()

Transform distribution by tangent function.

tanh()

Transform distribution by tanh function.

computeDensityGenerator

computeDensityGeneratorDerivative

computeDensityGeneratorSecondDerivative

__init__(*args)
abs()

Transform distribution by absolute value function.

Returns:
distDistribution

The transformed distribution.

acos()

Transform distribution by arccosine function.

Returns:
distDistribution

The transformed distribution.

acosh()

Transform distribution by acosh function.

Returns:
distDistribution

The transformed distribution.

asin()

Transform distribution by arcsine function.

Returns:
distDistribution

The transformed distribution.

asinh()

Transform distribution by asinh function.

Returns:
distDistribution

The transformed distribution.

atan()

Transform distribution by arctangent function.

Returns:
distDistribution

The transformed distribution.

atanh()

Transform distribution by atanh function.

Returns:
distDistribution

The transformed distribution.

cbrt()

Transform distribution by cubic root function.

Returns:
distDistribution

The transformed distribution.

computeBilateralConfidenceInterval(prob)

Compute a bilateral confidence interval.

Parameters:
alphafloat, \alpha \in [0,1]

The confidence level.

Returns:
confIntervalInterval

The confidence interval of level \alpha.

Notes

We consider an absolutely continuous measure \mu with density function p.

The bilateral confidence interval I^*_{\alpha} is the cartesian product I^*_{\alpha} = [a_1, b_1] \times \dots \times [a_d, b_d] where a_i = F_i^{-1}((1-\beta)/2) and b_i = F_i^{-1}((1+\beta)/2) for all i and which verifies \mu(I^*_{\alpha}) = \alpha.

Examples

Create a sample from a Normal distribution:

>>> import openturns as ot
>>> sample = ot.Normal().getSample(10)
>>> ot.ResourceMap.SetAsUnsignedInteger('DistributionFactory-DefaultBootstrapSize', 100)

Fit a Normal distribution and extract the asymptotic parameters distribution:

>>> fittedRes = ot.NormalFactory().buildEstimator(sample)
>>> paramDist = fittedRes.getParameterDistribution()

Determine the bilateral confidence interval at level 0.9:

>>> confInt = paramDist.computeBilateralConfidenceInterval(0.9)
computeBilateralConfidenceIntervalWithMarginalProbability(prob)

Compute a bilateral confidence interval.

Refer to computeBilateralConfidenceInterval()

Parameters:
alphafloat, \alpha \in [0,1]

The confidence level.

Returns:
confIntervalInterval

The confidence interval of level \alpha.

marginalProbfloat

The value \beta which is the common marginal probability of each marginal interval.

Examples

Create a sample from a Normal distribution:

>>> import openturns as ot
>>> sample = ot.Normal().getSample(10)
>>> ot.ResourceMap.SetAsUnsignedInteger('DistributionFactory-DefaultBootstrapSize', 100)

Fit a Normal distribution and extract the asymptotic parameters distribution:

>>> fittedRes = ot.NormalFactory().buildEstimator(sample)
>>> paramDist = fittedRes.getParameterDistribution()

Determine the bilateral confidence interval at level 0.9 with marginal probability:

>>> confInt, marginalProb = paramDist.computeBilateralConfidenceIntervalWithMarginalProbability(0.9)
computeCDF(*args)

Compute the cumulative distribution function.

Parameters:
Xsequence of float, 2-d sequence of float

CDF input(s).

Returns:
Ffloat, Point

CDF value(s) at input(s) X.

Notes

The cumulative distribution function is defined as:

F_{\vect{X}}(\vect{x}) = \Prob{\bigcap_{i=1}^n X_i \leq x_i},
                         \quad \vect{x} \in \supp{\vect{X}}

computeCDFGradient(*args)

Compute the gradient of the cumulative distribution function.

Parameters:
Xsequence of float

CDF input.

Returns:
dFdthetaPoint

Partial derivatives of the CDF with respect to the distribution parameters at input X.

computeCharacteristicFunction(x)

Compute the characteristic function.

Parameters:
tfloat

Characteristic function input.

Returns:
phicomplex

Characteristic function value at input t.

Notes

The characteristic function is defined as:

\phi_X(t) = \mathbb{E}\left[\exp(- i t X)\right],
            \quad t \in \Rset

OpenTURNS features a generic implementation of the characteristic function for all its univariate distributions (both continuous and discrete). This default implementation might be time consuming, especially as the modulus of t gets high. Only some univariate distributions benefit from dedicated more efficient implementations.

computeComplementaryCDF(*args)

Compute the complementary cumulative distribution function.

Parameters:
Xsequence of float, 2-d sequence of float

Complementary CDF input(s).

Returns:
Cfloat, Point

Complementary CDF value(s) at input(s) X.

Notes

The complementary cumulative distribution function.

1 - F_{\vect{X}}(\vect{x}) = 1 - \Prob{\bigcap_{i=1}^n X_i \leq x_i}, \quad \vect{x} \in \supp{\vect{X}}

Warning

This is not the survival function (except for 1-dimensional distributions).

computeConditionalCDF(*args)

Compute the conditional cumulative distribution function.

Parameters:
Xnfloat, sequence of float

Conditional CDF input (last component).

Xcondsequence of float, 2-d sequence of float with size n-1

Conditioning values for the other components.

Returns:
Ffloat, sequence of float

Conditional CDF value(s) at input X_n, X_{cond}.

Notes

The conditional cumulative distribution function of the last component with respect to the other fixed components is defined as follows:

F_{X_n \mid X_1, \ldots, X_{n - 1}}(x_n) =
    \Prob{X_n \leq x_n \mid X_1=x_1, \ldots, X_{n-1}=x_{n-1}},
    \quad x_n \in \supp{X_n}

computeConditionalDDF(x, y)

Compute the conditional derivative density function of the last component.

With respect to the other fixed components.

Parameters:
Xnfloat

Conditional DDF input (last component).

Xcondsequence of float with dimension n-1

Conditioning values for the other components.

Returns:
dfloat

Conditional DDF value at input X_n, X_{cond}.

computeConditionalPDF(*args)

Compute the conditional probability density function.

Conditional PDF of the last component with respect to the other fixed components.

Parameters:
Xnfloat, sequence of float

Conditional PDF input (last component).

Xcondsequence of float, 2-d sequence of float with size n-1

Conditioning values for the other components.

Returns:
Ffloat, sequence of float

Conditional PDF value(s) at input X_n, X_{cond}.

computeConditionalQuantile(*args)

Compute the conditional quantile function of the last component.

Conditional quantile with respect to the other fixed components.

Parameters:
pfloat, sequence of float, 0 < p < 1

Conditional quantile function input.

Xcondsequence of float, 2-d sequence of float with size n-1

Conditioning values for the other components.

Returns:
X1float

Conditional quantile at input p, X_{cond}.

computeDDF(*args)

Compute the derivative density function.

Parameters:
Xsequence of float, 2-d sequence of float

PDF input(s).

Returns:
dPoint, Sample

DDF value(s) at input(s) X.

Notes

The derivative density function is the gradient of the probability density function with respect to \vect{x}:

\vect{\nabla}_{\vect{x}} f_{\vect{X}}(\vect{x}) =
    \Tr{\left(\frac{\partial f_{\vect{X}}(\vect{x})}{\partial x_i},
              \quad i = 1, \ldots, n\right)},
    \quad \vect{x} \in \supp{\vect{X}}

computeEntropy()

Compute the entropy of the distribution.

Returns:
efloat

Entropy of the distribution.

Notes

The entropy of a distribution is defined by:

\cE_X = \Expect{-\log(p_X(\vect{X}))}

Where the random vector \vect{X} follows the probability distribution of interest, and p_X is either the probability density function of \vect{X} if it is continuous or the probability distribution function if it is discrete.

computeGeneratingFunction(*args)

Compute the probability-generating function.

Parameters:
zfloat or complex

Probability-generating function input.

Returns:
gfloat

Probability-generating function value at input X.

See also

isDiscrete

Notes

The probability-generating function is defined as follows:

G_X(z) = \Expect{z^X}, \quad z \in \Cset

This function only exists for discrete distributions. OpenTURNS implements this method for univariate distributions only.

computeInverseSurvivalFunction(point)

Compute the inverse survival function.

Parameters:
pfloat, p \in [0; 1]

Level of the survival function.

Returns:
xPoint

Point \vect{x} such that S_{\vect{X}}(\vect{x}) = p with iso-quantile components.

Notes

The inverse survival function writes: S^{-1}(p)  =  \vect{x}^p where S( \vect{x}^p) = \Prob{\bigcap_{i=1}^d X_i > x_i^p}. OpenTURNS returns the point \vect{x}^p such that \Prob{ X_1 > x_1^p}   =  \dots = \Prob{ X_d > x_d^p}.

computeLogCharacteristicFunction(x)

Compute the logarithm of the characteristic function.

Parameters:
tfloat

Characteristic function input.

Returns:
phicomplex

Logarithm of the characteristic function value at input t.

Notes

OpenTURNS features a generic implementation of the characteristic function for all its univariate distributions (both continuous and discrete). This default implementation might be time consuming, especially as the modulus of t gets high. Only some univariate distributions benefit from dedicated more efficient implementations.

computeLogGeneratingFunction(*args)

Compute the logarithm of the probability-generating function.

Parameters:
zfloat or complex

Probability-generating function input.

Returns:
lgfloat

Logarithm of the probability-generating function value at input X.

Notes

This function only exists for discrete distributions. OpenTURNS implements this method for univariate distributions only.

computeLogPDF(*args)

Compute the logarithm of the probability density function.

Parameters:
Xsequence of float, 2-d sequence of float

PDF input(s).

Returns:
ffloat, Point

Logarithm of the PDF value(s) at input(s) X.

computeLogPDFGradient(*args)

Compute the gradient of the log probability density function.

Parameters:
Xsequence of float

PDF input.

Returns:
dfdthetaPoint

Partial derivatives of the logPDF with respect to the distribution parameters at input X.

computeLowerExtremalDependenceMatrix()

Compute the lower extremal dependence coefficients.

We assume that the distribution is d-dimensional, with d \geq 2 and that its copula is denoted by C. The lower extremal dependence matrix is (\bar{\chi}_L^{ij})_{1 \leq i, j \leq d} where \\bar{\chi}_L^{ij} is the lower extremal dependence coefficient of the bivariate distribution (X_i, X_j). It is defined by:

\bar{\chi}_L^{ij} = \lim_{u \to 0} \bar{\chi}_L^{ij}(u)

where u \mapsto \bar{\chi}_L^{ij}(u) is the lower extremal dependence function of the bivariate distribution (X_i, X_j) defined by:

\bar{\chi}_L(u) = \frac{2 \log u}{\log C(u,u)} - 1, \forall u \in [0,1]

Refer to Tail dependence coefficients to get more details.

Returns:
depCorrelationMatrix

The dependence matrix.

Examples

>>> import openturns as ot
>>> copula = ot.FrankCopula()
>>> chiLb = copula.computeLowerExtremalDependenceMatrix()[1, 0]
computeLowerTailDependenceMatrix()

Compute the lower tail dependence coefficients.

We assume that the distribution is d-dimensional, with d \geq 2 and that its copula is denoted by C. The lower tail dependence matrix is (\chi_L^{ij})_{1 \leq i, j \leq d} where \chi_L^{ij} is the lower tail dependence coefficient of the bivariate distribution (X_i, X_j). It is defined by:

\chi_L^{ij} = \lim_{u \to 0} \chi_L^{ij}(u)

where u \mapsto \chi_L^{ij}(u) is the lower tail dependence function of the bivariate distribution (X_i, X_j) defined by:

\chi_L(u) = \frac{\log (1 - C(u,u))}{\log (1-u)}, \forall u \in [0,1]

Refer to Tail dependence coefficients to get more details.

Returns:
depCorrelationMatrix

The dependence matrix.

Examples

>>> import openturns as ot
>>> copula = ot.FrankCopula()
>>> chiL = copula.computeLowerTailDependenceMatrix()[1, 0]
computeMinimumVolumeInterval(prob)

Compute the confidence interval with minimum volume.

Parameters:
alphafloat, \alpha \in [0,1]

The confidence level.

Returns:
confIntervalInterval

The confidence interval of level \alpha.

Notes

We consider an absolutely continuous measure \mu with density function p.

The minimum volume confidence interval I^*_{\alpha} is the cartesian product I^*_{\alpha} = [a_1, b_1] \times \dots \times [a_d, b_d] where [a_i, b_i]   = \argmin_{I \in \Rset \, | \, \mu_i(I) = \beta} \lambda_i(I) and \mu(I^*_{\alpha})  =  \alpha with \lambda is the Lebesgue measure on \Rset^d.

This problem resorts to solving d univariate non linear equations: for a fixed value \beta, we find each intervals [a_i, b_i] such that:

\begin{eqnarray*}
F_i(b_i) - F_i(a_i) & = & \beta \\
p_i(b_i) & = & p_i(a_i)
\end{eqnarray*}

which consists of finding the bound a_i such that:

p_i(a_i) =  p_i(F_i^{-1}(\beta + F_i(a_i)))

To find \beta, we use the Brent algorithm: \mu([\vect{a}(\beta); \vect{b}(\beta)] = g(\beta) = \alpha with g a non linear function.

Examples

Create a sample from a Normal distribution:

>>> import openturns as ot
>>> sample = ot.Normal().getSample(10)
>&g