Skip to content
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

Updated docstrings in pymc.step_methods.metropolis for BinaryGibbsMetropolis to follow numpydoc #7212

Open
wants to merge 6 commits 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
35 changes: 19 additions & 16 deletions pymc/step_methods/metropolis.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,22 +140,25 @@ def __init__(

Parameters
----------
vars: list
List of value variables for sampler
S: standard deviation or covariance matrix
Some measure of variance to parameterize proposal distribution
proposal_dist: function
vars : list, optional
List of value variables for sampler.
S : array_like with shape (N,) or (N, N), optional
Scale parameter of normal distribution.
If `S` is one dimensional, it is the standard deviation of a normal distribution;
If `S` is two dimensional, it is the covariance matrix of a multivariate normal distribution.
proposal_dist : callable, optional
Function that returns zero-mean deviates when parameterized with
S (and n). Defaults to normal.
scaling: scalar or array
Initial scale factor for proposal. Defaults to 1.
tune: bool
`S` (and n). If `S` is one dimensional, it defaults to a normal, with `S` as its standard deviation;
If `S` is two dimensional, it defaults to a multivariate normal with `S` as its covariance matrix.
scaling : scalar or array_like, default 1.0
Initial scale factor for proposal. Defaults to 1.0.
tune : bool
Flag for tuning. Defaults to True.
tune_interval: int
tune_interval : int
The frequency of tuning. Defaults to 100 iterations.
model: PyMC Model
model : Model
Optional model for sampling step. Defaults to None (taken from context).
mode: string or `Mode` instance.
mode : string or `Mode` instance.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really know what Mode is so it would be nice to have it as a link, unfortunately I can't give a suggestion unless I know where it should point to. Hopefully someone else can comment on this

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a pytensor thing... Not sure we have a more precise signature anywhere. The class is https://github.com/pymc-devs/pytensor/blob/a76172ee6a9753266150fc7bac4dd66906967a26/pytensor/compile/mode.py#L275

But it can also be one of a predefined set of strings :D

compilation mode passed to PyTensor functions
"""

Expand Down Expand Up @@ -443,15 +446,15 @@ class BinaryGibbsMetropolis(ArrayStep):

Parameters
----------
vars: list
vars : list
List of value variables for sampler
order: list or 'random'
order : list or 'random'
List of integers indicating the Gibbs update order
e.g., [0, 2, 1, ...]. Default is random
transit_p: float
transit_p : float
The diagonal of the transition kernel. A value > .5 gives anticorrelated proposals,
which resulting in more efficient antithetical sampling. Default is 0.8
model: PyMC Model
model : PyMC Model
Optional model for sampling step. Defaults to None (taken from context).

"""
Expand Down