-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Updated docstrings in pymc.step_methods.metropolis for BinaryGibbsMetropolis to follow numpydoc #7212
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
base: main
Are you sure you want to change the base?
Updated docstrings in pymc.step_methods.metropolis for BinaryGibbsMetropolis to follow numpydoc #7212
Changes from 1 commit
d1fa3b9
fc416e1
440d894
54b5ed7
69e1347
ee9be0c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -140,22 +140,22 @@ def __init__( | |||||
|
||||||
Parameters | ||||||
---------- | ||||||
vars: list | ||||||
vars : list | ||||||
List of value variables for sampler | ||||||
S: standard deviation or covariance matrix | ||||||
S : standard deviation or covariance matrix | ||||||
Some measure of variance to parameterize proposal distribution | ||||||
proposal_dist: function | ||||||
proposal_dist : function | ||||||
HangenYuu marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
Function that returns zero-mean deviates when parameterized with | ||||||
S (and n). Defaults to normal. | ||||||
scaling: scalar or array | ||||||
scaling : scalar or array | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
for inputs unless it is required they are already a numpy array it is better to use array_like instead. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have changed this one based on your suggestions. |
||||||
Initial scale factor for proposal. Defaults to 1. | ||||||
tune: bool | ||||||
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 : PyMC Model | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
using only note, it might not work right now because a while back some objects were undocumented. For example, the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have changed this one based on your suggestions. |
||||||
Optional model for sampling step. Defaults to None (taken from context). | ||||||
mode: string or `Mode` instance. | ||||||
mode : string or `Mode` instance. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't really know what There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||||||
""" | ||||||
|
||||||
|
@@ -443,15 +443,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). | ||||||
|
||||||
""" | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
standard deviation or covariance matrix aren't types, this is mixing type with description. I think I have never used Metropolis, so my guess about behaviour here might be wrong but here is a proposal:
Then in
proposal_dist
description:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have changed this one based on your suggestions. I also changed
S
description to match.