Skip to content

Commit

Permalink
DOC: Fix documentation warnings (#653)
Browse files Browse the repository at this point in the history
  • Loading branch information
oyamad committed Nov 23, 2022
1 parent 7b31385 commit 179eb87
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 29 deletions.
2 changes: 1 addition & 1 deletion quantecon/discrete_rv.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def draw(self, k=1, random_state=None):
q[i].
Parameters
-----------
----------
k : scalar(int), optional
Number of draws to be returned
Expand Down
10 changes: 6 additions & 4 deletions quantecon/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,17 @@ def hamilton_filter(data, h, p=None):
Must be greater than h.
If not supplied, random walk process is assumed.
Note: For seasonal data, it's desirable for p and h to be integer multiples
of the number of obsevations in a year.
e.g. For quarterly data, h = 8 and p = 4 are recommended.
Returns
-------
cycle : array of cyclical component
trend : trend component
Notes
-----
For seasonal data, it's desirable for p and h to be integer multiples of
the number of obsevations in a year. E.g. for quarterly data, h = 8 and p =
4 are recommended.
"""
# transform data to array
y = np.asarray(data, float)
Expand Down
8 changes: 4 additions & 4 deletions quantecon/game_theory/logitdyn.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ def play(self, init_actions=None, player_ind_seq=None, num_reps=1,
random_state : np.random.RandomState, optional(default=None)
Random number generator used.
Return
------
Returns
-------
tuple(int)
The action profile after iterations.
Expand Down Expand Up @@ -137,8 +137,8 @@ def time_series(self, ts_length, init_actions=None, random_state=None):
random_state : np.random.RandomState, optional(default=None)
Random number generator used.
Return
------
Returns
-------
ndarray(int)
The array representing the time series of action profiles.
Expand Down
2 changes: 1 addition & 1 deletion quantecon/game_theory/support_enumeration.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def support_enumeration_gen(g):
NormalFormGame instance with 2 players.
Yields
-------
------
tuple(ndarray(float, ndim=1))
Tuple of Nash equilibrium mixed actions.
Expand Down
4 changes: 2 additions & 2 deletions quantecon/game_theory/vertex_enumeration.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def vertex_enumeration_gen(g, qhull_options=None):
manual <http://www.qhull.org>`_ for details.
Yields
-------
------
tuple(ndarray(float, ndim=1))
Tuple of Nash equilibrium mixed actions.
Expand Down Expand Up @@ -124,7 +124,7 @@ def _vertex_enumeration_gen(labelings_bits_tup, equations_tup, trans_recips):


class _BestResponsePolytope:
"""
r"""
Class that represents a best response polytope for a player in a
two-player normal form game.
Expand Down
8 changes: 4 additions & 4 deletions quantecon/inequality.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def gini_coefficient(y):
Implements the Gini inequality index
Parameters
-----------
----------
y : array_like(float)
Array of income/wealth for each individual.
Ordered or unordered is fine
Expand Down Expand Up @@ -88,13 +88,13 @@ def shorrocks_index(A):
Implements Shorrocks mobility index
Parameters
-----------
----------
A : array_like(float)
Square matrix with transition probabilities (mobility matrix) of
dimension m
Returns
--------
-------
Shorrocks index: float
The Shorrocks mobility index calculated as
Expand All @@ -105,7 +105,7 @@ def shorrocks_index(A):
An index equal to 0 indicates complete immobility.
References
-----------
----------
.. [1] Wealth distribution and social mobility in the US:
A quantitative approach (Benhabib, Bisin, Luo, 2017).
https://www.econ.nyu.edu/user/bisina/RevisionAugust.pdf
Expand Down
4 changes: 2 additions & 2 deletions quantecon/kalman.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Kalman:
Parameters
-----------
----------
ss : instance of LinearStateSpace
An instance of the quantecon.lss.LinearStateSpace class
x_hat : scalar(float) or array_like(float), optional(default=None)
Expand Down Expand Up @@ -241,7 +241,7 @@ def update(self, y):
self.filtered_to_forecast()

def stationary_values(self, method='doubling'):
"""
r"""
Computes the limit of :math:`\Sigma_t` as t goes to infinity by
solving the associated Riccati equation. The outputs are stored in the
attributes `K_infinity` and `Sigma_infinity`. Computation is via the
Expand Down
2 changes: 1 addition & 1 deletion quantecon/lss.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def simulate_linear_model(A, x0, v, ts_length):
The length of the time series
Returns
--------
-------
x : np.ndarray
Time series with ts_length columns, the t-th column being :math:`x_t`
"""
Expand Down
12 changes: 6 additions & 6 deletions quantecon/optimize/nelder_mead.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def nelder_mead(fun, x0, bounds=np.array([[], []]).T, args=(), tol_f=1e-10,
The maximum number of allowed iterations.
Returns
----------
-------
results : namedtuple
A namedtuple containing the following items:
::
Expand All @@ -78,7 +78,7 @@ def nelder_mead(fun, x0, bounds=np.array([[], []]).T, args=(), tol_f=1e-10,
[0.99999814, 0.99999756]]))
Notes
--------
-----
This algorithm has a long history of successful use in applications, but it
will usually be slower than an algorithm that uses first or second
derivative information. In practice, it can have poor performance in
Expand Down Expand Up @@ -170,7 +170,7 @@ def _nelder_mead_algorithm(fun, vertices, bounds=np.array([[], []]).T,
The maximum number of allowed iterations.
Returns
----------
-------
results : namedtuple
A namedtuple containing the following items:
::
Expand Down Expand Up @@ -312,7 +312,7 @@ def _initialize_simplex(x0, bounds):
Sequence of (min, max) pairs for each element in x0.
Returns
----------
-------
vertices : ndarray(float, ndim=2)
Initial simplex with shape (n+1, n).
Expand Down Expand Up @@ -396,7 +396,7 @@ def _check_bounds(x, bounds):
Sequence of (min, max) pairs for each element in x.
Returns
----------
-------
bool
`True` if `x` is within `bounds`, `False` otherwise.
Expand Down Expand Up @@ -434,7 +434,7 @@ def _neg_bounded_fun(fun, bounds, x, args=()):
Extra arguments passed to the objective function.
Returns
----------
-------
scalar
`-fun(x, *args)` if x is within `bounds`, `np.inf` otherwise.
Expand Down
2 changes: 1 addition & 1 deletion quantecon/quadsums.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def m_quadratic_sum(A, B, max_it=50):
The maximum number of iterations
Returns
========
-------
gamma1: array_like(float, ndim=2)
Represents the value :math:`V`
Expand Down
6 changes: 3 additions & 3 deletions quantecon/util/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ def check_random_state(seed):
Otherwise raise ValueError.
.. Note
----
1. This code was sourced from scikit-learn
Notes
-----
This code was sourced from scikit-learn.
"""
if seed is None or seed is np.random:
Expand Down

0 comments on commit 179eb87

Please sign in to comment.