FittingTest_AIC

FittingTest_AIC(*args)

Compute the Akaike information criterion.

Refer to Akaike Information Criterion (AIC).

Parameters
sample2-d sequence of float

Tested sample.

modelDistribution or DistributionFactory

Tested distribution.

n_parametersint, 0 \leq k, optional

The number of parameters in the distribution that have been estimated from the sample. This parameter must not be provided if a DistributionFactory was provided as the second argument (it will internally be set to the number of parameters estimated by the DistributionFactory). It can be specified if a Distribution was provided as the second argument, but if it is not, it will be set equal to 0.

Returns
estimatedDistDistribution

Estimated distribution (case factory as argument)

AICfloat

The Akaike information criterion.

Notes

This is used for model selection. In case we set a factory argument, the method returns both the estimated distribution and AIC value. Otherwise it returns only the AIC value.

Examples

>>> import openturns as ot
>>> ot.RandomGenerator.SetSeed(0)
>>> distribution = ot.Normal()
>>> sample = distribution.getSample(30)
>>> ot.FittingTest.AIC(sample, distribution)
2.793869...
>>> ot.FittingTest.AIC(sample, distribution, 2)
2.92720...
>>> fitted_dist, aic = ot.FittingTest.AIC(sample, ot.NormalFactory())
>>> aic
2.917389...