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
orDistributionFactory
Tested distributions.
- Returns
- best_model
Distribution
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.
- best_model
See also
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)