Skip to content

Commit

Permalink
Merge pull request #6412 from bashtage/forward-port-diagnostics
Browse files Browse the repository at this point in the history
CLN/MAINT: Port non-diagnostic changes
  • Loading branch information
bashtage committed Jan 14, 2020
2 parents fbe0736 + 7ccbc57 commit 76da0ea
Show file tree
Hide file tree
Showing 16 changed files with 30 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .codacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
engines:
pylint:
enabled: true
python_version: 2
python_version: 3
exclude_paths:
- '**/_version.py'
- 'versioneer.py'
8 changes: 0 additions & 8 deletions docs/source/diagnostic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,3 @@ individual outliers and might not be able to identify groups of outliers.
- det_cov_params_not_obsi
- params_not_obsi
- sigma2_not_obsi



Unit Root Tests
---------------

:py:func:`unitroot_adf <statsmodels.stats.diagnostic.unitroot_adf>`
- same as adfuller but with different signature
3 changes: 3 additions & 0 deletions docs/source/spelling_wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2295,3 +2295,6 @@ cp
bp
sirf
parametrized
nonlinearity
lexicographically
Appender
11 changes: 11 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[build-system]
requires = [
"setuptools",
"wheel",
"cython>=0.29.14",
"numpy==1.14.5; python_version=='3.5'",
"numpy==1.14.5; python_version=='3.6'",
"numpy==1.14.5; python_version>='3.7'",
"numpy==1.17.5; python_version>='3.8'",
"scipy>=1.0",
]
2 changes: 1 addition & 1 deletion statsmodels/graphics/gofplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ def qqplot(data, dist=stats.norm, distargs=(), a=0, loc=0, scale=1, fit=False,
data : array_like
A 1d data array.
dist : callable
Comparrison distribution. The default is
Comparison distribution. The default is
scipy.stats.distributions.norm (a standard normal).
distargs : tuple
A tuple of arguments passed to dist to specify it fully
Expand Down
2 changes: 1 addition & 1 deletion statsmodels/graphics/regressionplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def plot_partregress(endog, exog_i, exog_others, data=None,
The endogenous or response variable. If string is given, you can use a
arbitrary translations as with a formula.
exog_i : {ndarray, str}
THe exogenous, explanatory variable. If string is given, you can use a
The exogenous, explanatory variable. If string is given, you can use a
arbitrary translations as with a formula.
exog_others : {ndarray, list[str]}
Any other exogenous, explanatory variables. If a list of strings is
Expand Down
2 changes: 1 addition & 1 deletion statsmodels/multivariate/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def plot_scree(eigenvals, total_var, ncomp=None, x_label='factor'):
Parameters
----------
eigenvals : array_like
THe eigenvalues
The eigenvalues
total_var : float
the total variance (for plotting percent variance explained)
ncomp : int, optional
Expand Down
3 changes: 2 additions & 1 deletion statsmodels/regression/linear_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@

__docformat__ = 'restructuredtext en'

__all__ = ['GLS', 'WLS', 'OLS', 'GLSAR', 'PredictionResults']
__all__ = ['GLS', 'WLS', 'OLS', 'GLSAR', 'PredictionResults',
'RegressionResultsWrapper']


_fit_regularized_doc =\
Expand Down
2 changes: 1 addition & 1 deletion statsmodels/sandbox/distributions/extras.py
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ def absfunc(x):
* CORREL REAL, array of correlation coefficients; the correlation
* coefficient in row I column J of the correlation matrix
* should be stored in CORREL( J + ((I-2)*(I-1))/2 ), for J < I.
* THe correlation matrix must be positive semidefinite.
* The correlation matrix must be positive semidefinite.
* MAXPTS INTEGER, maximum number of function values allowed. This
* parameter can be used to limit the time. A sensible
* strategy is to start with MAXPTS = 1000*N, and then
Expand Down
7 changes: 3 additions & 4 deletions statsmodels/sandbox/stats/ex_newtests.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

from .diagnostic import unitroot_adf

from statsmodels.tsa.stattools import adfuller
import statsmodels.datasets.macrodata.data as macro

macrod = macro.load(as_pandas=False).data
Expand All @@ -26,5 +24,6 @@

print('%-10s %5s %-8s' % ('variable', 'trend', ' adf'))
for name, torder in datatrendli:
adf_, pval = unitroot_adf(macrod[name], trendorder=torder)[:2]
c_order = {0: "nc", 1: "c"}
adf_, pval = adfuller(macrod[name], regression=c_order[torder])[:2]
print('%-10s %5d %8.4f %8.4f' % (name, torder, adf_, pval))
2 changes: 1 addition & 1 deletion statsmodels/sandbox/tools/mctools.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def run(self, nrepl, statindices=None, dgpargs=[], statsargs=[]):
for ii in range(1, nrepl-1, nreturns):
x = dgp(*dgpargs) #(1e-4+np.random.randn(nobs)).cumsum()
#should I ravel?
mcres[ii] = statfun(x, *statsargs) #unitroot_adf(x, 2,trendorder=0, autolag=None)
mcres[ii] = statfun(x, *statsargs)
#more than one return statistic
else:
self.nreturn = nreturns = len(statindices)
Expand Down
2 changes: 1 addition & 1 deletion statsmodels/stats/stattools.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def omni_normtest(resids, axis=0):

def jarque_bera(resids, axis=0):
r"""
Calculates the Jarque-Bera test for normality
The Jarque-Bera test of normality.
Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion statsmodels/tools/validation/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def array_like(obj, name, dtype=np.double, ndim=1, maxdim=None,
__array__ method returns an array, or any (nested) sequence.
name : str
Name of the variable to use in exceptions
dtype : {None, numpy.dtype}
dtype : {None, numpy.dtype, str}
Required dtype. Default is double. If None, does not change the dtype
of obj (if present) or uses NumPy to automatically detect the dtype
ndim : {int, None}
Expand Down
1 change: 1 addition & 0 deletions statsmodels/tsa/ar_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1830,6 +1830,7 @@ def test_serial_correlation(self, lags=None, model_df=None):
See Also
--------
statsmodels.stats.diagnostic.acorr_ljungbox
Ljung-Box test for serial correlation.
"""
# Deferred to prevent circular import
from statsmodels.stats.diagnostic import acorr_ljungbox
Expand Down
1 change: 1 addition & 0 deletions statsmodels/tsa/statespace/mlemodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2910,6 +2910,7 @@ def test_normality(self, method):
See Also
--------
statsmodels.stats.stattools.jarque_bera
The Jarque-Bera test of normality.
"""
if method is None:
method = 'jarquebera'
Expand Down
2 changes: 1 addition & 1 deletion statsmodels/tsa/tests/test_adfuller_lag.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
"""Test for autolag of adfuller, unitroot_adf
"""Test for autolag of adfuller
Created on Wed May 30 21:39:46 2012
Author: Josef Perktold
Expand Down

0 comments on commit 76da0ea

Please sign in to comment.