This file is indexed.

/usr/include/openturns/swig/FittingTest_doc.i is in libopenturns-dev 1.9-5.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
%feature("docstring") OT::FittingTest::BestModelBIC
"Select the best model according to the Bayesian information criterion.

Parameters
----------
sample : 2-d sequence of float
    Tested sample.
models : list of :class:`~openturns.Distribution` or :class:`~openturns.DistributionFactory`
    Tested distributions.

Returns
-------
best_model : :class:`~openturns.Distribution`
    The best distribution for the sample according to Bayesian information
    criterion.
    This may raise a warning if the best model does not perform well.

See Also
--------
FittingTest_BIC

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

// ---------------------------------------------------------------------

%feature("docstring") OT::FittingTest::BestModelChiSquared
"Select the best model according to the :math:`\\\\chi^2` goodness-of-fit test.

Parameters
----------
sample : 2-d sequence of float
    Tested sample.
models : list of :class:`~openturns.Distribution` or :class:`~openturns.DistributionFactory`
    Tested distributions.

Returns
-------
best_model : :class:`~openturns.Distribution`
    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_result : :class:`~openturns.TestResult`
    Best test result.

See Also
--------
FittingTest_ChiSquared

Examples
--------
>>> import openturns as ot
>>> ot.RandomGenerator.SetSeed(0)
>>> distribution = ot.Poisson()
>>> sample = distribution.getSample(30)
>>> tested_distributions = [ot.PoissonFactory(), ot.UserDefinedFactory()]
>>> best_model = ot.FittingTest.BestModelBIC(sample, tested_distributions)
>>> print(best_model)
Poisson(lambda = 1.06667)"

// ---------------------------------------------------------------------

%feature("docstring") OT::FittingTest::BestModelKolmogorov
"Select the best model according to the Kolmogorov goodness-of-fit test.

Parameters
----------
sample : 2-d sequence of float
    Tested sample.
models : list of :class:`~openturns.Distribution` or :class:`~openturns.DistributionFactory`
    Tested distributions.

Returns
-------
best_model : :class:`~openturns.Distribution`
    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_result : :class:`~openturns.TestResult`
    Best test result.

See Also
--------
FittingTest_Kolmogorov

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

// ---------------------------------------------------------------------

%feature("docstring") OT::FittingTest::BIC
"Compute the Bayesian information criterion.

Parameters
----------
sample : 2-d sequence of float
    Tested sample.
model : :class:`~openturns.Distribution` or :class:`~openturns.DistributionFactory`
    Tested distribution.
n_parameters : int, :math:`0 \\\\leq k`, optional
    The number of parameters in the distribution that have been estimated from
    the sample.
    This parameter must not be provided if a :class:`~openturns.DistributionFactory`
    was provided as the second argument (it will internally be set to the
    number of parameters estimated by the :class:`~openturns.DistributionFactory`).
    It can be specified if  a :class:`~openturns.Distribution` 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:

.. math::

    {\\\\rm BIC} = \\\\frac{1}{m}
                \\\\left(- 2 \\\\log L(\\\\vect{x}^{(i)}, i = 1, \\\\ldots, m)
                      + k \\\\log m\\\\right)

where :math:`\\\\log L` denotes the log-likelihood of the sample with respect to
the given distribution, and :math:`k` 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"

// ---------------------------------------------------------------------

%feature("docstring") OT::FittingTest::ChiSquared
"Perform a :math:`\\\\chi^2` goodness-of-fit test for 1-d discrete distributions.

Parameters
----------
sample : 2-d sequence of float
    Tested sample.
model : :class:`~openturns.Distribution` or :class:`~openturns.DistributionFactory`
    Tested distribution.
level : float, :math:`0 \\\\leq {\\\\rm level} \\\\leq 1`, optional
    This the value such that :math:`\\\\alpha = 1 - {\\\\rm level}` is the risk of
    committing a Type I error, that is an incorrect rejection of a true
    null hypothesis.
n_parameters : int, :math:`0 \\\\leq k`, optional
    The number of parameters in the distribution that have been estimated from
    the sample.
    This parameter must not be provided if a :class:`~openturns.DistributionFactory`
    was provided as the second argument (it will internally be set to the
    number of parameters estimated by the :class:`~openturns.DistributionFactory`).
    It can be specified if  a :class:`~openturns.Distribution` was provided
    as the second argument, but if it is not, it will be set equal to 0.

Returns
-------
test_result : :class:`~openturns.TestResult`
    Test result.

Raises
------
TypeError : If the distribution is not discrete or if the sample is
    multivariate.

Notes
-----
This is an interface to the `chisq.test function from the
'stats' R package <http://stat.ethz.ch/R-manual/R-patched/library/stats/html/chisq.test.html>`_.

Examples
--------
>>> import openturns as ot
>>> ot.RandomGenerator.SetSeed(0)
>>> distribution = ot.Poisson()
>>> sample = distribution.getSample(30)
>>> ot.FittingTest.ChiSquared(sample, ot.PoissonFactory(), .99)
class=TestResult name=Unnamed type=ChiSquaredPoisson binaryQualityMeasure=true p-value threshold=0.01 p-value=0.606136 description=[]"

// ---------------------------------------------------------------------

%feature("docstring") OT::FittingTest::Kolmogorov
"Perform a Kolmogorov goodness-of-fit test for 1-d continuous distributions.

Parameters
----------
sample : 2-d sequence of float
    Tested sample.
model : :class:`~openturns.Distribution` or :class:`~openturns.DistributionFactory`
    Tested distribution.
level : float, :math:`0 \\\\leq {\\\\rm level} \\\\leq 1`, optional
    This is the value such that :math:`\\\\alpha = 1 - {\\\\rm level}` is the risk of
    committing a Type I error, that is an incorrect rejection of a true
    null hypothesis.
n_parameters : int, :math:`0 \\\\leq k`, optional
    The number of parameters in the distribution that have been estimated from
    the sample.
    This parameter must not be provided if a :class:`~openturns.DistributionFactory`
    was provided as the second argument (it will internally be set to the
    number of parameters estimated by the :class:`~openturns.DistributionFactory`).
    It can be specified if  a :class:`~openturns.Distribution` was provided
    as the second argument, but if it is not, it will be set equal to 0.

Returns
-------
test_result : :class:`~openturns.TestResult`
    Test result.

Raises
------
TypeError : If the distribution is not continuous or if the sample is
    multivariate.

Notes
-----
The present implementation of the Kolmogorov goodness-of-fit test is
two-sided. This uses an external C implementation of the Kolmogorov cumulative
distribution function by [Simard2011]_.

Examples
--------
>>> import openturns as ot
>>> ot.RandomGenerator.SetSeed(0)
>>> distribution = ot.Normal()
>>> sample = distribution.getSample(30)
>>> ot.FittingTest.Kolmogorov(sample, ot.NormalFactory(), .99)
class=TestResult name=Unnamed type=KolmogorovDistribution binaryQualityMeasure=true p-value threshold=0.01 p-value=0.846896 description=[Normal(mu = -0.0944924, sigma = 0.989808) vs sample Normal]"

// ---------------------------------------------------------------------

%feature("docstring") OT::FittingTest::TwoSamplesKolmogorov
"Perform a Kolmogorov goodness-of-fit test on two samples.

If the p-value is high, then we cannot reject the hypothesis that the
distributions of the two samples are the same.

Parameters
----------
sample1 : 2-d float array
    A continuous distribution sample.
sample2 : 2-d float array
    Another continuous distribution sample, can be of different size.
level : float, :math:`0 \\\\leq {\\\\rm level} \\\\leq 1`, optional
    This the value such that :math:`\\\\alpha = 1 - {\\\\rm level}` is the risk of
    committing a Type I error, that is an incorrect rejection of a true
    null hypothesis.

Returns
-------
test_result : :class:`~openturns.TestResult`
    Test result.

Examples
--------
>>> import openturns as ot
>>> ot.RandomGenerator.SetSeed(0)
>>> sample1 = ot.Normal().getSample(20)
>>> sample2 = ot.Normal(0.1, 1.1).getSample(30)
>>> ot.FittingTest.TwoSamplesKolmogorov(sample1, sample2)
class=TestResult name=Unnamed type=Kolmogorov Normal/Normal binaryQualityMeasure=true p-value threshold=0.05 p-value=0.554765 description=[sampleNormal vs sample Normal]"