# ProductDistribution distribution¶

class ProductDistribution(*args)

Product distribution.

Helper class for defining the push-forward distribution of a given univariate distribution by a given scalar function.

Available constructors:

ProductDistribution(distX, distY)

Parameters:
distXDistribution, univariate

Independent of distY

distYDistribution, univariate

Independent of distX

Returns:
distZDistribution, univariate

is the distribution of the random variable when is a random vector with independent copula and respective marginal distributions distX and distY.

Notes

We note the scalar random variable which distribution is .

with , and the probability density functions of and .

Its first moments, if finite, are defined as:

Examples

Create a distribution:

>>> import openturns as ot
>>> distX = ot.Normal(-1.0, 1.0)
>>> distY = ot.Uniform(-1.0, 1.0)
>>> distZ = ot.ProductDistribution(distX, distY)

Draw a sample:

>>> sample = distZ.getSample(5)

Methods

 setLeft setRight
__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,

The confidence level.

Returns:
confIntervalInterval

The confidence interval of level .

Notes

We consider an absolutely continuous measure with density function .

The bilateral confidence interval is the cartesian product where and for all and which verifies .

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.

Parameters:
alphafloat,

The confidence level.

Returns:
confIntervalInterval

The confidence interval of level .

marginalProbfloat

The value 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) .

Notes

The cumulative distribution function is defined as:

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 .

computeCharacteristicFunction(x)

Compute the characteristic function.

Parameters:
tfloat

Characteristic function input.

Returns:
phicomplex

Characteristic function value at input .

Notes

The characteristic function is defined as:

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

Notes

The complementary cumulative distribution function.

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

Conditionning values for the other components.

Returns:
Ffloat, sequence of float

Conditional CDF value(s) at input , .

Notes

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

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

Conditionning values for the other components.

Returns:
dfloat

Conditional DDF value at input , .

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

Conditionning values for the other components.

Returns:
Ffloat, sequence of float

Conditional PDF value(s) at input , .

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,

Conditional quantile function input.

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

Conditionning values for the other components.

Returns:
X1float

Conditional quantile at input , .

computeDDF(*args)

Compute the derivative density function.

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

PDF input(s).

Returns:
d

DDF value(s) at input(s) .

Notes

The derivative density function is the gradient of the probability density function with respect to :

computeDensityGenerator(betaSquare)

Compute the probability density function of the characteristic generator.

PDF of the characteristic generator of the elliptical distribution.

Parameters:
beta2float

Density generator input.

Returns:
pfloat

Density generator value at input .

Notes

This is the function such that the probability density function rewrites:

This function only exists for elliptical distributions.

computeDensityGeneratorDerivative(betaSquare)

Compute the first-order derivative of the probability density function.

PDF of the characteristic generator of the elliptical distribution.

Parameters:
beta2float

Density generator input.

Returns:
pfloat

Density generator first-order derivative value at input .

Notes

This function only exists for elliptical distributions.

computeDensityGeneratorSecondDerivative(betaSquare)

Compute the second-order derivative of the probability density function.

PDF of the characteristic generator of the elliptical distribution.

Parameters:
beta2float

Density generator input.

Returns:
pfloat

Density generator second-order derivative value at input .

Notes

This function only exists for elliptical distributions.

computeEntropy()

Compute the entropy of the distribution.

Returns:
efloat

Entropy of the distribution.

Notes

The entropy of a distribution is defined by:

Where the random vector follows the probability distribution of interest, and is either the probability density function of 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 .

isDiscrete

Notes

The probability-generating function is defined as follows:

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

computeInverseSurvivalFunction(point)

Compute the inverse survival function.

Parameters:
pfloat,

Level of the survival function.

Returns:
xPoint

Point such that with iso-quantile components.

Notes

The inverse survival function writes: where . OpenTURNS returns the point such that .

computeLogCharacteristicFunction(*args)

Compute the logarithm of the characteristic function.

Parameters:
tfloat

Characteristic function input.

Returns:
phicomplex

Logarithm of the characteristic function value at input .

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

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

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 .

computeLowerExtremalDependenceMatrix()

Compute the lower extremal dependence coefficients.

We assume that the distribution is -dimensional, with and that its copula is denoted by . The lower extremal dependence matrix is where is the lower extremal dependence coefficient of the bivariate distribution . It is defined by:

where is the lower extremal dependence function of the bivariate distribution defined by:

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 -dimensional, with and that its copula is denoted by . The lower tail dependence matrix is where is the lower tail dependence coefficient of the bivariate distribution . It is defined by:

where is the lower tail dependence function of the bivariate distribution defined by:

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,

The confidence level.

Returns:
confIntervalInterval

The confidence interval of level .

Notes

We consider an absolutely continuous measure with density function .

The minimum volume confidence interval is the cartesian product where and with is the Lebesgue measure on .

This problem resorts to solving univariate non linear equations: for a fixed value , we find each intervals such that: