FittingTest_BestModelBIC

FittingTest_BestModelBIC(*args)

Select the best model according to the Bayesian information criterion.

Parameters
sample2-d sequence of float

Tested sample.

modelslist of Distribution or DistributionFactory

Tested distributions.

Returns
best_modelDistribution

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

best_bicfloat

The Bayesian information criterion with the best model.

See also

FittingTest_BIC

Notes

The best model is the one which achieves the smallest BIC value. In case of ties, the order in the list matters: the first one which minimizes the BIC in the list is selected.

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_bic = ot.FittingTest.BestModelBIC(sample, tested_distributions)
>>> print(best_model)
Normal(mu = -0.0944924, sigma = 0.989808)