Skip to content

Commit

Permalink
MAINT: stats: correct name Gilbrat -> Gibrat
Browse files Browse the repository at this point in the history
  • Loading branch information
mdhaber committed Apr 1, 2022
1 parent 6f3c7be commit eee0b18
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion doc/source/tutorial/stats.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ introspection:
>>> dist_discrete = [d for d in dir(stats) if
... isinstance(getattr(stats, d), stats.rv_discrete)]
>>> print('number of continuous distributions: %d' % len(dist_continu))
number of continuous distributions: 105
number of continuous distributions: 106
>>> print('number of discrete distributions: %d' % len(dist_discrete))
number of discrete distributions: 19

Expand Down
6 changes: 3 additions & 3 deletions doc/source/tutorial/stats/continuous_gilbrat.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

.. _continuous-gilbrat:
.. _continuous-gibrat:

Gilbrat Distribution
Gibrat Distribution
====================

Special case of the log-normal with :math:`\sigma=1` and :math:`S=1.0`, typically also :math:`L=0.0`.)
Expand All @@ -27,4 +27,4 @@ Special case of the log-normal with :math:`\sigma=1` and :math:`S=1.0`, typicall
\begin{eqnarray*} h\left[X\right] & = & \log\left(\sqrt{2\pi e}\right)\\
& \approx & 1.4189385332046727418\end{eqnarray*}
Implementation: `scipy.stats.gilbrat`
Implementation: `scipy.stats.gibrat`
2 changes: 1 addition & 1 deletion scipy/stats/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
genhalflogistic -- Generalized Half Logistic
genhyperbolic -- Generalized Hyperbolic
geninvgauss -- Generalized Inverse Gaussian
gilbrat -- Gilbrat
gibrat -- Gibrat
gompertz -- Gompertz (Truncated Gumbel)
gumbel_r -- Right Sided Gumbel, Log-Weibull, Fisher-Tippett, Extreme Value Type I
gumbel_l -- Left Sided Gumbel, etc.
Expand Down
11 changes: 6 additions & 5 deletions scipy/stats/_continuous_distns.py
Original file line number Diff line number Diff line change
Expand Up @@ -5425,20 +5425,20 @@ def fit(self, data, *args, **kwds):
lognorm = lognorm_gen(a=0.0, name='lognorm')


class gilbrat_gen(rv_continuous):
r"""A Gilbrat continuous random variable.
class gibrat_gen(rv_continuous):
r"""A Gibrat continuous random variable.
%(before_notes)s
Notes
-----
The probability density function for `gilbrat` is:
The probability density function for `gibrat` is:
.. math::
f(x) = \frac{1}{x \sqrt{2\pi}} \exp(-\frac{1}{2} (\log(x))^2)
`gilbrat` is a special case of `lognorm` with ``s=1``.
`gibrat` is a special case of `lognorm` with ``s=1``.
%(after_notes)s
Expand Down Expand Up @@ -5478,7 +5478,8 @@ def _entropy(self):
return 0.5 * np.log(2 * np.pi) + 0.5


gilbrat = gilbrat_gen(a=0.0, name='gilbrat')
gilbrat = gibrat_gen(a=0.0, name='gilbrat')
gibrat = gibrat_gen(a=0.0, name='gibrat')


class maxwell_gen(rv_continuous):
Expand Down
2 changes: 2 additions & 0 deletions scipy/stats/_distr_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
['halfgennorm', (0.6748054997000371,)],
['genpareto', (0.1,)], # use case with finite moments
['gilbrat', ()],
['gibrat', ()],
['gompertz', (0.94743713075105251,)],
['gumbel_l', ()],
['gumbel_r', ()],
Expand Down Expand Up @@ -207,6 +208,7 @@
['genhalflogistic', (-1, )],
['geninvgauss', (1, 0)],
['gilbrat', ()],
['gibrat', ()],
['gompertz', (-1, )],
['gumbel_r', ()],
['gumbel_l', ()],
Expand Down
2 changes: 1 addition & 1 deletion scipy/stats/tests/test_distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def assert_fit_warnings(dist):
@pytest.mark.parametrize('dist',
['alpha', 'betaprime',
'fatiguelife', 'invgamma', 'invgauss', 'invweibull',
'johnsonsb', 'levy', 'levy_l', 'lognorm', 'gilbrat',
'johnsonsb', 'levy', 'levy_l', 'lognorm', 'gibrat',
'powerlognorm', 'rayleigh', 'wald'])
def test_support(dist):
"""gh-6235"""
Expand Down
2 changes: 1 addition & 1 deletion scipy/stats/tests/test_sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ def test_basic(self, dist, mv_ex):
# numerical differences. They can be avoided either by changing
# the seed or by increasing the u_resolution.
fail_dists = ['ncf', 'pareto', 'chi2', 'fatiguelife', 'halfgennorm',
'gilbrat', 'lognorm', 'ncx2', 't']
'gibrat', 'lognorm', 'ncx2', 't']

@pytest.mark.xslow
@pytest.mark.parametrize("distname, params", distcont)
Expand Down

0 comments on commit eee0b18

Please sign in to comment.