From d1fa3b914333a777e709ab6befcef025f952a4c3 Mon Sep 17 00:00:00 2001 From: HangenYuu <97870091+HangenYuu@users.noreply.github.com> Date: Fri, 22 Mar 2024 13:34:24 +0000 Subject: [PATCH 1/4] fixed docstring of BinaryGibbsMetropolis --- pymc/step_methods/metropolis.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pymc/step_methods/metropolis.py b/pymc/step_methods/metropolis.py index 4a595d3700..7cbc90c4a5 100644 --- a/pymc/step_methods/metropolis.py +++ b/pymc/step_methods/metropolis.py @@ -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 Function that returns zero-mean deviates when parameterized with S (and n). Defaults to normal. - scaling: scalar or array + scaling : scalar or array 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 Optional model for sampling step. Defaults to None (taken from context). - mode: string or `Mode` instance. + mode : string or `Mode` instance. 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). """ From 440d89406f650745fc91ca5a59101149d7bb149a Mon Sep 17 00:00:00 2001 From: HangenYuu <97870091+HangenYuu@users.noreply.github.com> Date: Fri, 22 Mar 2024 13:34:24 +0000 Subject: [PATCH 2/4] fixed docstring of BinaryGibbsMetropolis --- pymc/step_methods/metropolis.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pymc/step_methods/metropolis.py b/pymc/step_methods/metropolis.py index 6c3f2b8a09..baf9b7c37d 100644 --- a/pymc/step_methods/metropolis.py +++ b/pymc/step_methods/metropolis.py @@ -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 Function that returns zero-mean deviates when parameterized with S (and n). Defaults to normal. - scaling: scalar or array + scaling : scalar or array 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 Optional model for sampling step. Defaults to None (taken from context). - mode: string or `Mode` instance. + mode : string or `Mode` instance. 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). """ From 54b5ed7ce6e5cfe4bb4b1b13a7ac924e45cd9ff5 Mon Sep 17 00:00:00 2001 From: HangenYuu Date: Sun, 7 Apr 2024 14:15:40 +0800 Subject: [PATCH 3/4] Fixed docstring based on Oriol's suggestions --- pymc/step_methods/metropolis.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/pymc/step_methods/metropolis.py b/pymc/step_methods/metropolis.py index baf9b7c37d..05b4097b8c 100644 --- a/pymc/step_methods/metropolis.py +++ b/pymc/step_methods/metropolis.py @@ -140,20 +140,23 @@ 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. + `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 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. compilation mode passed to PyTensor functions From ee9be0c2a959016b1610b00107b4d0cee7ca055a Mon Sep 17 00:00:00 2001 From: Pham Nguyen Hung <97870091+HangenYuu@users.noreply.github.com> Date: Sun, 7 Apr 2024 15:36:42 +0800 Subject: [PATCH 4/4] Update metropolis.py --- pymc/step_methods/metropolis.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pymc/step_methods/metropolis.py b/pymc/step_methods/metropolis.py index 6fed219635..05b4097b8c 100644 --- a/pymc/step_methods/metropolis.py +++ b/pymc/step_methods/metropolis.py @@ -446,18 +446,14 @@ 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).