AIC¶
- AIC(*args)¶
Compute the Akaike information criterion.
Refer to Akaike Information Criterion (AIC).
- Parameters
- sample2-d sequence of float
Tested sample.
- model
Distribution
orDistributionFactory
Tested distribution.
- n_parametersint, , 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 theDistributionFactory
). It can be specified if aDistribution
was provided as the second argument, but if it is not, it will be set equal to 0.
- Returns
- estimatedDist
Distribution
Estimated distribution (case factory as argument)
- AICfloat
The Akaike information criterion.
- estimatedDist
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...