Skip to content

Updated docstrings in pymc.step_methods.arraystep.py #7796

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 42 additions & 25 deletions pymc/step_methods/arraystep.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,16 @@ class ArrayStep(BlockedStep):

Parameters
----------
vars: list
vars : list
List of value variables for sampler.
fs: list of logp PyTensor functions
allvars: Boolean (default False)
blocked: Boolean (default True)
rng: RandomGenerator
An object that can produce be used to produce the step method's
fs : list
Logp PyTensor functions.
allvars : bool, default False
Whether to pass all model variables to the logp functions.
blocked : bool, default True
Whether variables are updated jointly or separately.
rng : RandomGenerator
An object that can be used to produce the step method's
:py:class:`~numpy.random.Generator` object. Refer to
:py:func:`pymc.util.get_random_generator` for more information.
"""
Expand Down Expand Up @@ -90,11 +93,14 @@ def __init__(self, vars, shared, blocked=True, rng: RandomGenerator = None):

Parameters
----------
vars: list of sampling value variables
shared: dict of PyTensor variable -> shared variable
blocked: Boolean (default True)
rng: RandomGenerator
An object that can produce be used to produce the step method's
vars : list
Sampling value variables.
shared : dict
PyTensor variable -> shared variable.
blocked : bool, default True
Whether variables are updated jointly or separately.
rng : RandomGenerator
An object that can be used to produce the step method's
:py:class:`~numpy.random.Generator` object. Refer to
:py:func:`pymc.util.get_random_generator` for more information.
"""
Expand Down Expand Up @@ -138,11 +144,14 @@ def __init__(self, vars, shared, blocked=True, rng: RandomGenerator = None):

Parameters
----------
vars: list of sampling value variables
shared: dict of PyTensor variable -> shared variable
blocked: Boolean (default True)
rng: RandomGenerator
An object that can produce be used to produce the step method's
vars : list
Sampling value variables.
shared : dict
PyTensor variable -> shared variable.
blocked : bool, default True
Whether variables are updated jointly or separately.
rng : RandomGenerator
An object that can be used to produce the step method's
:py:class:`~numpy.random.Generator` object. Refer to
:py:func:`pymc.util.get_random_generator` for more information.
"""
Expand All @@ -156,9 +165,11 @@ def link_population(self, population, chain_index):

Parameters
----------
population: list of Points. (The elements of this list must be
replaced with current chain states in every iteration.)
chain_index: int of the index of this sampler in the population
population : list of Points
The elements of this list must be replaced with current chain
states in every iteration.
chain_index : int
The index of this sampler in the population.
"""
self.population = population
self.this_chain = chain_index
Expand Down Expand Up @@ -216,15 +227,21 @@ def metrop_select(

Parameters
----------
mr: float, Metropolis acceptance rate
q: proposed sample
q0: current sample
rng: numpy.random.Generator
A random number generator object
mr : float
Metropolis acceptance rate.
q : np.ndarray
Proposed sample.
q0 : np.ndarray
Current sample.
rng : numpy.random.Generator
A random number generator object.

Returns
-------
q or q0
np.ndarray
The accepted sample (`q` or `q0`).
bool
Whether the proposed `q` was accepted.
"""
# Compare acceptance ratio to uniform random number
# TODO XXX: This `uniform` is not given a model-specific RNG state, which
Expand Down
Loading