Skip to content

Commit e12de82

Browse files
committed
DOC: Add decprecated and versionadded admonitions
1 parent b061678 commit e12de82

File tree

11 files changed

+125
-17
lines changed

11 files changed

+125
-17
lines changed

docs/source/release/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Release Notes
77
.. toctree::
88
:maxdepth: 1
99

10-
version0.14
10+
version0.14.0
1111
version0.13.4-5
1212
version0.13.3
1313
version0.13.2

docs/source/release/version0.14.rst renamed to docs/source/release/version0.14.0.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ selection or treatment model, outcome model and effect functions.
4444

4545
Hurdle and Truncated Count Regression
4646
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
47-
:class:`statsmodels.discrete.truncated_model.HurdleModel` implements
47+
:class:`statsmodels.discrete.truncated_model.HurdleCountModel` implements
4848
hurdle models for count data with either Poisson or NegativeBinomialP as
4949
submodels.
5050
Three left truncated models used for zero truncation are available,
5151
:class:`statsmodels.discrete.truncated_model.TruncatedLFPoisson`,
5252
:class:`statsmodels.discrete.truncated_model.TruncatedLFNegativeBinomialP`
5353
and
54-
:class:`statsmodels.discrete.truncated_model.TruncatedLFGeneralized Poisson`.
54+
:class:`statsmodels.discrete.truncated_model.TruncatedLFGeneralizedPoisson`.
5555
Models for right censoring at one are implemented but only as support for
5656
the hurdle models.
5757

@@ -108,7 +108,7 @@ Other Notable Enhancments
108108
-------------------------
109109

110110
- burg option in pacf :pr:`8113`
111-
- new link for GLM: logc :pr:`8155`
111+
- new link for GLM: Logc :pr:`8155`
112112
- rename class names for links for GLM, lower case names are deprecated :pr:`8569`
113113
- allow singular covariance in gaussian copula :pr:`8504`
114114
- GLM: Tweedie full loglikelihood :pr:`8560`

statsmodels/discrete/discrete_model.py

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,11 @@ def predict(self, params, exog=None, which="mean", linear=None,
506506
- 'var' returns the estimated variance of endog implied by the
507507
model.
508508
509+
.. versionadded: 0.14
510+
511+
``which`` replaces and extends the deprecated ``linear``
512+
argument.
513+
509514
linear : bool
510515
If True, returns the linear predicted values. If False or None,
511516
then the statistic specified by ``which`` will be returned.
@@ -741,9 +746,28 @@ def predict(self, params, exog=None, which="mean", linear=None):
741746
it assumed to be 1 row of exogenous variables. If you only have
742747
one regressor and would like to do prediction, you must provide
743748
a 2d array with shape[1] == 1.
744-
linear : bool, optional
745-
If True, returns the linear predictor dot(exog,params). Else,
746-
returns the value of the cdf at the linear predictor.
749+
which : {'mean', 'linear', 'var', 'prob'}, optional
750+
Statistic to predict. Default is 'mean'.
751+
752+
- 'mean' returns the conditional expectation of endog E(y | x),
753+
i.e. exp of linear predictor.
754+
- 'linear' returns the linear predictor of the mean function.
755+
- 'var' returns the estimated variance of endog implied by the
756+
model.
757+
758+
.. versionadded: 0.14
759+
760+
``which`` replaces and extends the deprecated ``linear``
761+
argument.
762+
763+
linear : bool
764+
If True, returns the linear predicted values. If False or None,
765+
then the statistic specified by ``which`` will be returned.
766+
767+
.. deprecated: 0.14
768+
769+
The ``linear` keyword is deprecated and will be removed,
770+
use ``which`` keyword instead.
747771
748772
Notes
749773
-----
@@ -999,12 +1023,21 @@ def predict(self, params, exog=None, exposure=None, offset=None,
9991023
- 'var' variance of endog implied by the likelihood model
10001024
- 'prob' predicted probabilities for counts.
10011025
1026+
.. versionadded: 0.14
1027+
1028+
``which`` replaces and extends the deprecated ``linear``
1029+
argument.
1030+
10021031
linear : bool
1003-
The ``linear` keyword is deprecated and will be removed,
1004-
use ``which`` keyword instead.
10051032
If True, returns the linear predicted values. If False or None,
10061033
then the statistic specified by ``which`` will be returned.
10071034
1035+
.. deprecated: 0.14
1036+
1037+
The ``linear` keyword is deprecated and will be removed,
1038+
use ``which`` keyword instead.
1039+
1040+
10081041
Notes
10091042
-----
10101043
If exposure is specified, then it will be logged by the method.
@@ -1621,11 +1654,22 @@ def predict(self, params, exog=None, exposure=None, offset=None,
16211654
- 'prob' return probabilities for counts from 0 to max(endog) or
16221655
for y_values if those are provided.
16231656
1657+
.. versionadded: 0.14
1658+
1659+
``which`` replaces and extends the deprecated ``linear``
1660+
argument.
1661+
16241662
linear : bool
16251663
The ``linear` keyword is deprecated and will be removed,
16261664
use ``which`` keyword instead.
16271665
If True, returns the linear predicted values. If False or None,
16281666
then the statistic specified by ``which`` will be returned.
1667+
1668+
.. deprecated: 0.14
1669+
1670+
The ``linear` keyword is deprecated and will be removed,
1671+
use ``which`` keyword instead.
1672+
16291673
y_values : array_like
16301674
Values of the random variable endog at which pmf is evaluated.
16311675
Only used if ``which="prob"``

statsmodels/discrete/truncated_model.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
class TruncatedLFGeneric(CountModel):
3232
__doc__ = """
3333
Generic Truncated model for count data
34+
35+
.. versionadded:: 0.14.0
3436
3537
%(params)s
3638
%(extra_params)s
@@ -433,6 +435,8 @@ class TruncatedLFPoisson(TruncatedLFGeneric):
433435
__doc__ = """
434436
Truncated Poisson model for count data
435437
438+
.. versionadded:: 0.14.0
439+
436440
%(params)s
437441
%(extra_params)s
438442
@@ -504,6 +508,8 @@ class TruncatedLFNegativeBinomialP(TruncatedLFGeneric):
504508
__doc__ = """
505509
Truncated Generalized Negative Binomial model for count data
506510
511+
.. versionadded:: 0.14.0
512+
507513
%(params)s
508514
%(extra_params)s
509515
@@ -588,6 +594,8 @@ class TruncatedLFGeneralizedPoisson(TruncatedLFGeneric):
588594
__doc__ = """
589595
Truncated Generalized Poisson model for count data
590596
597+
.. versionadded:: 0.14.0
598+
591599
%(params)s
592600
%(extra_params)s
593601
@@ -1037,6 +1045,8 @@ def _prob_nonzero(self, mu, params):
10371045
class HurdleCountModel(CountModel):
10381046
__doc__ = """
10391047
Hurdle model for count data
1048+
1049+
.. versionadded:: 0.14.0
10401050
10411051
%(params)s
10421052
%(extra_params)s

statsmodels/stats/_diagnostic_other.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,10 @@ def dispersion_poisson(results):
202202
Each test has two strings a descriptive name and a string for the
203203
alternative hypothesis.
204204
"""
205-
msg = 'dispersion_poisson here is deprecated, use '
205+
msg = (
206+
'dispersion_poisson here is deprecated, use the version in '
207+
'discrete._diagnostic_count'
208+
)
206209
warnings.warn(msg, FutureWarning)
207210

208211
from statsmodels.discrete._diagnostics_count import test_poisson_dispersion
@@ -225,7 +228,10 @@ def dispersion_poisson_generic(results, exog_new_test, exog_new_control=None,
225228
226229
Warning: insufficiently tested, especially for options
227230
"""
228-
msg = 'dispersion_poisson here is deprecated, use '
231+
msg = (
232+
'dispersion_poisson_generic here is deprecated, use the version in '
233+
'discrete._diagnostic_count'
234+
)
229235
warnings.warn(msg, FutureWarning)
230236

231237
from statsmodels.discrete._diagnostics_count import (

statsmodels/stats/multitest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,13 +400,21 @@ def fdrcorrection_twostage(pvals, alpha=0.05, method='bky',
400400
maxiter=False is two-stage fdr (maxiter=1)
401401
maxiter=True is full iteration (maxiter=-1 or maxiter=len(pvals))
402402
403+
.. versionadded:: 0.14
404+
405+
Replacement for ``iter`` with additional features.
406+
403407
iter : bool
404408
``iter`` is deprecated use ``maxiter`` instead.
405409
If iter is True, then only one iteration step is used, this is the
406410
two-step method.
407411
If iter is False, then iterations are stopped at convergence which
408412
occurs in a finite number of steps (at most len(pvals) steps).
409413
414+
.. deprecated:: 0.14
415+
416+
Use ``maxiter`` instead of ``iter``.
417+
410418
Returns
411419
-------
412420
rejected : ndarray, bool

statsmodels/stats/rates.py

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -638,9 +638,19 @@ def test_poisson_2indep(count1, exposure1, count2, exposure2, value=None,
638638
ratio_null: float
639639
Ratio of the two Poisson rates under the Null hypothesis. Default is 1.
640640
Deprecated, use ``value`` instead.
641+
642+
.. deprecaated:: 0.14.0
643+
644+
Use ``value`` instead.
645+
641646
value : float
642647
Value of the ratio or difference of 2 independent rates under the null
643648
hypothesis. Default is equal rates, i.e. 1 for ratio and 0 for diff.
649+
650+
.. versionadded:: 0.14.0
651+
652+
Replacement for ``ratio_null``.
653+
644654
method : string
645655
Method for the test statistic and the p-value. Defaults to `'score'`.
646656
see Notes.
@@ -747,13 +757,13 @@ def test_poisson_2indep(count1, exposure1, count2, exposure2, value=None,
747757
# default method
748758
method = 'score'
749759

750-
if ratio_null is None and value is None:
751-
# default value
752-
value = ratio_null = 1
753-
elif ratio_null is not None:
760+
if ratio_null is not None:
754761
warnings.warn("'ratio_null' is deprecated, use 'value' keyword",
755762
FutureWarning)
756763
value = ratio_null
764+
if ratio_null is None and value is None:
765+
# default value
766+
value = ratio_null = 1
757767
else:
758768
# for results holder instance, it still contains ratio_null
759769
ratio_null = value
@@ -932,9 +942,19 @@ def etest_poisson_2indep(count1, exposure1, count2, exposure2, ratio_null=None,
932942
ratio_null: float
933943
Ratio of the two Poisson rates under the Null hypothesis. Default is 1.
934944
Deprecated, use ``value`` instead.
945+
946+
.. deprecaated:: 0.14.0
947+
948+
Use ``value`` instead.
949+
935950
value : float
936951
Value of the ratio or diff of 2 independent rates under the null
937952
hypothesis. Default is equal rates, i.e. 1 for ratio and 0 for diff.
953+
954+
.. versionadded:: 0.14.0
955+
956+
Replacement for ``ratio_null``.
957+
938958
method : {"score", "wald"}
939959
Method for the test statistic that defines the rejection region.
940960
alternative : string
@@ -953,6 +973,10 @@ def etest_poisson_2indep(count1, exposure1, count2, exposure2, ratio_null=None,
953973
Same as y_grid. Deprecated. If both y_grid and ygrid are provided,
954974
ygrid will be ignored.
955975
976+
.. deprecaated:: 0.14.0
977+
978+
Use ``y_grid`` instead.
979+
956980
Returns
957981
-------
958982
stat_sample : float

statsmodels/treatment/treatment_effects.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,10 @@ def __init__(self, teff, results_gmm, method, **kwds):
604604

605605

606606
class TreatmentEffect(object):
607-
"""Estimate average treatment effect under conditional independence
607+
"""
608+
Estimate average treatment effect under conditional independence
609+
610+
.. versionadded:: 0.14.0
608611
609612
This class estimates treatment effect and potential outcome using 5
610613
different methods, ipw, ra, aipw, aipw-wls, ipw-ra.

statsmodels/tsa/ar_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class AutoReg(tsa_model.TimeSeriesModel):
148148
old_names : bool
149149
Flag indicating whether to use the v0.11 names or the v0.12+ names.
150150
151-
.. deprecated:: 0.13
151+
.. deprecated:: 0.13.0
152152
153153
old_names is deprecated and will be removed after 0.14 is
154154
released. You must update any code reliant on the old variable

statsmodels/tsa/statespace/simulation_smoother.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,9 +614,20 @@ def simulate(self, simulation_output=-1,
614614
disturbance_variates : bool, optional
615615
Deprecated, please use pretransformed_measurement_shocks and
616616
pretransformed_state_shocks instead.
617+
618+
.. deprecated:: 0.14.0
619+
620+
Use ``measurement_disturbance_variates`` and
621+
``state_disturbance_variates`` as replacements.
622+
617623
pretransformed : bool, optional
618624
Deprecated, please use pretransformed_measurement_shocks and
619625
pretransformed_state_shocks instead.
626+
627+
.. deprecated:: 0.14.0
628+
629+
Use ``pretransformed_measurement_disturbance_variates`` and
630+
``pretransformed_state_disturbance_variates`` as replacements.
620631
"""
621632
# Handle deprecated argumennts
622633
if disturbance_variates is not None:

0 commit comments

Comments
 (0)