Skip to content

Commit

Permalink
DOC: Correct spacing around colon in docstrings
Browse files Browse the repository at this point in the history
Ensure that param : type is correctly spaced
  • Loading branch information
bashtage committed Jul 21, 2020
1 parent b9e1bc0 commit 17b053c
Show file tree
Hide file tree
Showing 39 changed files with 217 additions and 226 deletions.
12 changes: 6 additions & 6 deletions statsmodels/discrete/count_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class GenericZeroInflated(CountModel):
A reference to the endogenous response variable
exog : ndarray
A reference to the exogenous design.
exog_infl: ndarray
exog_infl : ndarray
A reference to the zero-inflated exogenous design.
""" % {'params' : base._model_params_doc,
'extra_params' : _doc_zi_params + base._missing_param_doc}
Expand Down Expand Up @@ -466,7 +466,7 @@ class ZeroInflatedPoisson(GenericZeroInflated):
A reference to the endogenous response variable
exog : ndarray
A reference to the exogenous design.
exog_infl: ndarray
exog_infl : ndarray
A reference to the zero-inflated exogenous design.
""" % {'params' : base._model_params_doc,
'extra_params' : _doc_zi_params + base._missing_param_doc}
Expand Down Expand Up @@ -554,9 +554,9 @@ class ZeroInflatedGeneralizedPoisson(GenericZeroInflated):
A reference to the endogenous response variable
exog : ndarray
A reference to the exogenous design.
exog_infl: ndarray
exog_infl : ndarray
A reference to the zero-inflated exogenous design.
p: scalar
p : scalar
P denotes parametrizations for ZIGP regression.
""" % {'params' : base._model_params_doc,
'extra_params' : _doc_zi_params +
Expand Down Expand Up @@ -632,9 +632,9 @@ class ZeroInflatedNegativeBinomialP(GenericZeroInflated):
A reference to the endogenous response variable
exog : ndarray
A reference to the exogenous design.
exog_infl: ndarray
exog_infl : ndarray
A reference to the zero-inflated exogenous design.
p: scalar
p : scalar
P denotes parametrizations for ZINB regression. p=1 for ZINB-1 and
p=2 for ZINB-2. Default is p=2
""" % {'params' : base._model_params_doc,
Expand Down
19 changes: 10 additions & 9 deletions statsmodels/distributions/edgeworth.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,21 @@


def _faa_di_bruno_partitions(n):
""" Return all non-negative integer solutions of the diophantine equation
"""
Return all non-negative integer solutions of the diophantine equation
n*k_n + ... + 2*k_2 + 1*k_1 = n (1)
Parameters
----------
n: int
n : int
the r.h.s. of Eq. (1)
Returns
-------
partitions: a list of solutions of (1). Each solution is itself
a list of the form `[(m, k_m), ...]` for non-zero `k_m`.
Notice that the index `m` is 1-based.
partitions : list
Each solution is itself a list of the form `[(m, k_m), ...]`
for non-zero `k_m`. Notice that the index `m` is 1-based.
Examples:
---------
Expand All @@ -58,16 +59,16 @@ def cumulant_from_moments(momt, n):
Parameters
----------
momt: array_like
momt : array_like
`momt[j]` contains `(j+1)`-th moment.
These can be raw moments around zero, or central moments
(in which case, `momt[0]` == 0).
n: int
n : int
which cumulant to calculate (must be >1)
Returns
-------
kappa: float
kappa : float
n-th cumulant.
"""
if n < 1:
Expand Down Expand Up @@ -103,7 +104,7 @@ class ExpandedNormal(rv_continuous):
Parameters
----------
cum: array_like
cum : array_like
`cum[j]` contains `(j+1)`-th cumulant: cum[0] is the mean,
cum[1] is the variance and so on.
Expand Down
64 changes: 23 additions & 41 deletions statsmodels/emplike/aft_el.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ def _opt_wtd_nuis_regress(self, test_vals):
Returns
-------
llr: float
llr : float
-2 times the log likelihood of the nuisance parameters and the
hypothesized value of the parameter(s) of interest.
"""
Expand All @@ -95,10 +94,10 @@ def _EM_test(self, nuisance_params, params=None, param_nums=None,
Parameters
----------
Nuisance Params: ndarray
nuisance_params : ndarray
Vector of values to be used as nuisance params.
maxiter: int
maxiter : int
Number of iterations in the EM algorithm for a parameter vector
Returns
Expand Down Expand Up @@ -160,8 +159,7 @@ def _ci_limits_beta(self, b0, param_num=None):
----------
b0: float
Value of a regression parameter
param_num: int
param_num : int
Parameter index of b0
"""
return self.test_beta([b0], [param_num])[0] - self.r0
Expand All @@ -187,29 +185,21 @@ class emplikeAFT(object):
Attributes
----------
nobs: float
nobs : float
Number of observations
endog: ndarray
endog : ndarray
Endog attay
exog: ndarray
exog : ndarray
Exogenous variable matrix
censors
Censors array but sets the max(endog) to uncensored
nvar: float
nvar : float
Number of exogenous variables
uncens_nobs: float
uncens_nobs : float
Number of uncensored observations
uncens_endog: ndarray
uncens_endog : ndarray
Uncensored response variables
uncens_exog: ndarray
uncens_exog : ndarray
Exogenous variables of the uncensored observations
Methods
Expand Down Expand Up @@ -254,14 +244,14 @@ def _is_tied(self, endog, censors):
Parameters
----------
endog: ndarray
endog : ndarray
Models endogenous variable
censors: ndarray
censors : ndarray
arrat indicating a censored array
Returns
-------
indic_ties: ndarray
indic_ties : ndarray
ties[i]=1 if endog[i]==endog[i+1] and
censors[i]=censors[i+1]
"""
Expand Down Expand Up @@ -398,20 +388,16 @@ def test_beta(self, b0_vals, param_nums, ftol=10 ** - 5, maxiter=30,
Parameters
----------
b0_vals: list
b0_vals : list
The value of parameters to be tested
param_num: list
param_num : list
Which parameters to be tested
maxiter: int, optional
maxiter : int, optional
How many iterations to use in the EM algorithm. Default is 30
ftol: float, optional
ftol : float, optional
The function tolerance for the EM optimization.
Default is 10''**''-5
print_weights: bool
print_weights : bool
If true, returns the weights tate maximize the profile
log likelihood. Default is False
Expand Down Expand Up @@ -507,17 +493,13 @@ def ci_beta(self, param_num, beta_high, beta_low, sig=.05):
Parameters
----------
param_num: int
param_num : int
Parameter number of interest
beta_high: float
beta_high : float
Upper bound for the confidence interval
beta_low:
beta_low : float
Lower bound for the confidence interval
sig: float, optional
sig : float, optional
Significance level. Default is .05
Notes
Expand Down
2 changes: 1 addition & 1 deletion statsmodels/gam/gam_penalties.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class MultivariateGamPenalty(Penalty):
alpha : list of float
default penalty weight, list with length equal to the number of smooth
terms. ``alpha`` can also be provided to each method.
weights: array_like
weights : array_like
currently not used
is a list of doubles of the same length as alpha or a list
of ndarrays where each component has the length equal to the number
Expand Down
12 changes: 9 additions & 3 deletions statsmodels/gam/smooth_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,10 +668,16 @@ def _get_b_and_d(self, knots):
Returns
-------
b, d: ndarrays
arrays for mapping cyclic cubic spline values at knots to
b : ndarray
Array for mapping cyclic cubic spline values at knots to
second derivatives.
penalty matrix is equal to ``s = d.T.dot(b^-1).dot(d)``
d : ndarray
Array for mapping cyclic cubic spline values at knots to
second derivatives.
Notes
-----
The penalty matrix is equal to ``s = d.T.dot(b^-1).dot(d)``
"""
h = knots[1:] - knots[:-1]
n = knots.size - 1
Expand Down
12 changes: 6 additions & 6 deletions statsmodels/genmod/cov_struct.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,18 @@ def covariance_matrix(self, endog_expval, index):
Parameters
----------
endog_expval: array_like
endog_expval : array_like
The expected values of endog for the cluster for which the
covariance or correlation matrix will be returned
index: int
index : int
The index of the cluster for which the covariance or
correlation matrix will be returned
Returns
-------
M: matrix
M : matrix
The covariance or correlation matrix of endog
is_cor: bool
is_cor : bool
True if M is a correlation matrix, False if M is a
covariance matrix
"""
Expand All @@ -104,10 +104,10 @@ def covariance_matrix_solve(self, expval, index, stdev, rhs):
Parameters
----------
expval: array_like
expval : array_like
The expected value of endog for each observed value in the
group.
index: int
index : int
The group index.
stdev : array_like
The standard deviation of endog for each observation in
Expand Down
4 changes: 2 additions & 2 deletions statsmodels/genmod/families/links.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def deriv(self, p):
Parameters
----------
p: array_like
p : array_like
Probabilities
Returns
Expand Down Expand Up @@ -731,7 +731,7 @@ def deriv2(self, p):
Parameters
----------
p: array_like
p : array_like
Probabilities
Returns
Expand Down
6 changes: 3 additions & 3 deletions statsmodels/iolib/summary2.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ def add_df(self, df, index=True, header=True, float_format='%.4f',
Parameters
----------
df : DataFrame
header: bool
header : bool
Reproduce the DataFrame column labels in summary table
index: bool
index : bool
Reproduce the DataFrame row labels in summary table
float_format : str
Formatting to float data columns
Expand Down Expand Up @@ -77,7 +77,7 @@ def add_dict(self, d, ncols=2, align='l', float_format="%.4f"):
d : dict
Keys and values are automatically coerced to strings with str().
Users are encouraged to format them before using add_dict.
ncols: int
ncols : int
Number of columns of the output table
align : str
Data alignment (l/c/r)
Expand Down
4 changes: 2 additions & 2 deletions statsmodels/multivariate/cancorr.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ class CanCorr(Model):
See Parameters.
cancorr : ndarray
The canonical correlation values
y_cancoeff: ndarray
y_cancoeff : ndarray
The canonical coefficients for endog
x_cancoeff: ndarray
x_cancoeff : ndarray
The canonical coefficients for exog
References
Expand Down
6 changes: 3 additions & 3 deletions statsmodels/multivariate/factor.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,10 +501,10 @@ class FactorResults(object):
Attributes
----------
uniqueness: ndarray
uniqueness : ndarray
The uniqueness (variance of uncorrelated errors unique to
each variable)
communality: ndarray
communality : ndarray
1 - uniqueness
loadings : ndarray
Each column is the loading vector for one factor
Expand Down Expand Up @@ -979,7 +979,7 @@ def uniq_stderr(self, kurt=0):
Parameters
----------
kurt: float
kurt : float
Excess kurtosis
Notes
Expand Down

0 comments on commit 17b053c

Please sign in to comment.