DistributionValidation

class DistributionValidation(*args)

Automates distribution tests.

It helps performing tests to validate Distribution services:

  • Comparison operators

  • PDF: analytical PDF vs finite-difference estimate from CDF

  • Log PDF: verify consistency of PDF and LogPDF values

  • DDF: analytical DDF vs finite-difference estimate from PDF

  • CCDF: verify consistency between CDF and complementary CDF

  • Survival function: verify consistency between survival and CDF values

  • Inverse survival function: verify consistency between inverse survival and survival

  • Quantile function: verify consistency between quantile and CDF values

  • Probability of an interval: verify probabilities of the range, full numerical range

  • Fitting: Pass Kolmogorov or Chi2 test for different sampling sizes

  • Entropy test: verify consistency between analytical entropy and empirical entropy

  • Moments: verify consistency between analytical moments and empirical moments

  • Parameters: verify setParameter/getParameter accessors consistency

  • Gradients: assess PDF/CDF analytical gradients consistency against their finite difference estimates

  • Minimum volume interval: verify the probability of the interval

  • Minimum volume level-set: verify the probability of the level-set

  • Confidence interval: verify the probability of the level-set

  • Characteristic function

  • Conditional PDF/CDF/Quantiles: verify consistency of sequential version

  • Iso probabilistic transformation: verify bijection and gradients

Parameters:
distributionDistribution

The distribution instance to test.

Methods

run()

Run all tests.

setCDFSamplingSize(cdfSamplingSize)

Sampling size accessor for CDF test.

setCDFTolerance(cdfTolerance)

CDF test tolerance accessor.

setCorrelationTolerance(correlationTolerance)

Correlation test tolerance accessor.

setDDFTolerance(ddfTolerance)

DDF test tolerance accessor.

setDomainSamplingSize(domainSamplingSize)

Sampling size accessor for domain tests.

setDomainTolerance(domainTolerance)

Domain test tolerance accessor.

setEntropySamplingSize(entropySamplingSize)

Sampling size accessor for entropy test.

setEntropyTolerance(entropyTolerance)

Entropy test tolerance accessor.

setFittingSamplingSize(fittingSamplingSize)

Sampling size accessor for fitting test.

setKurtosisTolerance(kurtosisTolerance)

Kurtosis test tolerance accessor.

setMeanTolerance(meanTolerance)

Mean test tolerance accessor.

setMomentsSamplingSize(momentsSamplingSize)

Sampling size accessor for moments test.

setPDFSamplingSize(pdfSamplingSize)

Sampling size accessor for PDF test.

setPDFTolerance(pdfTolerance)

PDF test tolerance accessor.

setParameterTolerance(parameterTolerance)

PDF/CDF parameter gradient test tolerance accessor.

setQuantileTolerance(quantileTolerance)

Quantile test tolerance accessor.

setSkewnessTolerance(skewnessTolerance)

Skewness test tolerance accessor.

setStandardDeviationTolerance(...)

Standard deviation test tolerance accessor.

skipCDF()

Disables CDF test.

skipCharacteristicFunction()

Disables characteristic function test.

skipComplementaryCDF()

Disables CCDF test.

skipConditional()

Disables conditional test.

skipConfidenceInterval()

Disables confidence interval test.

skipCorrelation()

Disables Correlation test.

skipDDF()

Disables DDF test.

skipEntropy()

Disables entropy test.

skipGeneratingFunction()

Disables generating function test.

skipGradient()

Disables PDF/CDF gradients test.

skipMinimumVolumeInterval()

Disables minimum volume interval test.

skipMinimumVolumeLevelSet()

Disables minimum volume level set test.

skipMoments()

Disables moments test.

skipPDF()

Disables PDF test.

skipParameters()

Disables parameters test.

skipProbability()

Disables probability test.

skipTransformation()

Disables transformation test.

Examples

>>> import openturns as ot
>>> import openturns.testing as ott
>>> dist = ot.Uniform(0.0, 1.0)
>>> checker = ott.DistributionValidation(dist)
>>> ot.Log.Show(ot.Log.TRACE)  
>>> checker.run()  
__init__(*args)
run()

Run all tests.

The method raises an exception on the first test that fails. Enable Log at TRACE level to see more details.

setCDFSamplingSize(cdfSamplingSize)

Sampling size accessor for CDF test.

Parameters:
cdfSamplingSizeint

Sampling size for CDF test.

setCDFTolerance(cdfTolerance)

CDF test tolerance accessor.

Parameters:
cdfTolerancefloat

Relative and absolute tolerance of the cdf, probability, ccdf and survival tests.

setCorrelationTolerance(correlationTolerance)

Correlation test tolerance accessor.

Parameters:
correlationTolerancefloat

Relative and absolute tolerance of the analytical/empirical correlations comparison.

setDDFTolerance(ddfTolerance)

DDF test tolerance accessor.

Parameters:
ddfTolerancefloat

Relative and absolute tolerance of the ddf.

setDomainSamplingSize(domainSamplingSize)

Sampling size accessor for domain tests.

Parameters:
domainSamplingSizeint

Sampling size for domain tests (minimum volume interval, level set or confidence intervals).

setDomainTolerance(domainTolerance)

Domain test tolerance accessor.

Parameters:
domainTolerancefloat

Relative and absolute tolerance of the mini volume, level set or confidence interval tests.

setEntropySamplingSize(entropySamplingSize)

Sampling size accessor for entropy test.

Parameters:
entropySamplingSizeint

Sampling size for entropy test.

setEntropyTolerance(entropyTolerance)

Entropy test tolerance accessor.

Parameters:
entropyTolerancefloat

Relative and absolute tolerance of the analytical/empirical entropy comparison.

setFittingSamplingSize(fittingSamplingSize)

Sampling size accessor for fitting test.

Parameters:
fittingSamplingSizeint

Sampling size for fitting test.

setKurtosisTolerance(kurtosisTolerance)

Kurtosis test tolerance accessor.

Parameters:
kurtosisTolerancefloat

Relative and absolute tolerance of the analytical/empirical kurtosis comparison.

setMeanTolerance(meanTolerance)

Mean test tolerance accessor.

Parameters:
meanTolerancefloat

Relative and absolute tolerance of the analytical/empirical mean comparison.

setMomentsSamplingSize(momentsSamplingSize)

Sampling size accessor for moments test.

Parameters:
momentsSamplingSizeint

Sampling size for moments test.

setPDFSamplingSize(pdfSamplingSize)

Sampling size accessor for PDF test.

Parameters:
pdfSamplingSizeint

Sampling size for PDF test.

setPDFTolerance(pdfTolerance)

PDF test tolerance accessor.

Parameters:
pdfTolerancefloat

Relative and absolute tolerance of the pdf.

setParameterTolerance(parameterTolerance)

PDF/CDF parameter gradient test tolerance accessor.

Parameters:
parameterTolerancefloat

Relative and absolute tolerance of the PDF/CDF parameter gradient.

setQuantileTolerance(quantileTolerance)

Quantile test tolerance accessor.

Parameters:
quatileTolerancefloat

Relative and absolute tolerance of the quantile and inverse survival.

setSkewnessTolerance(skewnessTolerance)

Skewness test tolerance accessor.

Parameters:
skewnessTolerancefloat

Relative and absolute tolerance of the analytical/empirical skewness comparison.

setStandardDeviationTolerance(standardDeviationTolerance)

Standard deviation test tolerance accessor.

Parameters:
standardDeviationTolerancefloat

Relative and absolute tolerance of the analytical/empirical deviation comparison.

skipCDF()

Disables CDF test.

skipCharacteristicFunction()

Disables characteristic function test.

skipComplementaryCDF()

Disables CCDF test.

skipConditional()

Disables conditional test.

skipConfidenceInterval()

Disables confidence interval test.

skipCorrelation()

Disables Correlation test.

skipDDF()

Disables DDF test.

skipEntropy()

Disables entropy test.

skipGeneratingFunction()

Disables generating function test.

skipGradient()

Disables PDF/CDF gradients test.

skipMinimumVolumeInterval()

Disables minimum volume interval test.

skipMinimumVolumeLevelSet()

Disables minimum volume level set test.

skipMoments()

Disables moments test.

skipPDF()

Disables PDF test.

skipParameters()

Disables parameters test.

skipProbability()

Disables probability test.

skipTransformation()

Disables transformation test.

Examples using the class

Create a customized distribution or copula

Create a customized distribution or copula