FittingTest_BestModelAIC

FittingTest_BestModelAIC(*args)

Select the best model according to the Akaike information criterion.

Parameters
sample2-d sequence of float

Tested sample.

modelslist of Distribution or DistributionFactory

Tested distributions.

Returns
best_modelDistribution

The best distribution for the sample according to Bayesian information criterion. This may raise a warning if the best model does not perform well.

best_aicfloat

The Akaike information criterion with the best model.

See also

FittingTest_AIC

Examples

>>> import openturns as ot
>>> ot.RandomGenerator.SetSeed(0)
>>> distribution = ot.Normal()
>>> sample = distribution.getSample(30)
>>> tested_distributions = [ot.ExponentialFactory(), ot.NormalFactory()]
>>> best_model, best_aic = ot.FittingTest.BestModelAIC(sample, tested_distributions)
>>> print(best_model)
Normal(mu = -0.0944924, sigma = 0.989808)