FittingTest_BIC¶

FittingTest_BIC
(*args)¶ Compute the Bayesian information criterion.
Parameters: sample : 2d sequence of float
Tested sample.
model :
Distribution
orDistributionFactory
Tested distribution.
n_parameters : int, , 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: BIC : float
The Bayesian information criterion.
Notes
The Bayesian information criterion is defined as follows:
where denotes the loglikelihood of the sample with respect to the given distribution, and denotes the number of estimated parameters in the distribution.
This is used for model selection.
Examples
>>> import openturns as ot >>> ot.RandomGenerator.SetSeed(0) >>> distribution = ot.Normal() >>> sample = distribution.getSample(30) >>> ot.FittingTest.BIC(sample, distribution) 2.7938693005063415 >>> ot.FittingTest.BIC(sample, distribution, 2) 3.0206157926171517 >>> ot.FittingTest.BIC(sample, ot.NormalFactory()) 3.0108025506670955