Skip to content

Commit 121a5ae

Browse files
Remove reference to old parameters in SMC docstring (#5914)
Co-authored-by: Ricardo Vieira <[email protected]>
1 parent c180ae3 commit 121a5ae

File tree

2 files changed

+10
-17
lines changed

2 files changed

+10
-17
lines changed

pymc/smc/sample_smc.py

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def sample_smc(
7474
The number of chains to run in parallel. If ``None``, set to the number of CPUs in the
7575
system.
7676
compute_convergence_checks : bool
77-
Whether to compute sampler statistics like Gelman-Rubin and ``effective_n``.
77+
Whether to compute sampler statistics like ``R hat`` and ``effective_n``.
7878
Defaults to ``True``.
7979
return_inferencedata : bool, default=True
8080
Whether to return the trace as an :class:`arviz:arviz.InferenceData` (True) object or a `MultiTrace` (False)
@@ -89,16 +89,9 @@ def sample_smc(
8989
Determines the change of beta from stage to stage, i.e. indirectly the number of stages,
9090
the higher the value of `threshold` the higher the number of stages. Defaults to 0.5.
9191
It should be between 0 and 1.
92-
n_steps: int
93-
The number of steps of each Markov Chain. If ``tune_steps == True`` ``n_steps`` will be used
94-
for the first stage and for the others it will be determined automatically based on the
95-
acceptance rate and `p_acc_rate`, the max number of steps is ``n_steps``.
96-
tune_steps: bool
97-
Whether to compute the number of steps automatically or not. Defaults to True
98-
p_acc_rate: float
99-
Used to compute ``n_steps`` when ``tune_steps == True``. The higher the value of
100-
``p_acc_rate`` the higher the number of steps computed automatically. Defaults to 0.85.
101-
It should be between 0 and 1.
92+
correlation_threshold: float
93+
The lower the value the higher the number of MCMC steps computed automatically.
94+
Defaults to 0.01. It should be between 0 and 1.
10295
Keyword arguments for other kernels should be checked in the respective docstrings
10396
10497
Notes
@@ -124,11 +117,11 @@ def sample_smc(
124117
likelihoods of a sample at stage i+1 and stage i.
125118
5. Obtain :math:`S_{w}` by re-sampling according to W.
126119
6. Use W to compute the mean and covariance for the proposal distribution, a MVNormal.
127-
7. For stages other than 0 use the acceptance rate from the previous stage to estimate
128-
`n_steps`.
129-
8. Run N independent Metropolis-Hastings (IMH) chains (each one of length `n_steps`),
130-
starting each one from a different sample in :math:`S_{w}`. Samples are IMH as the proposal
131-
mean is the of the previous posterior stage and not the current point in parameter space.
120+
7. Run N independent MCMC chains, starting each one from a different sample
121+
in :math:`S_{w}`. For the IMH kernel, the mean of the proposal distribution is the
122+
mean of the previous posterior stage and not the current point in parameter space.
123+
8. The N chains are run until the autocorrelation with the samples from the previous stage
124+
stops decreasing given a certain threshold.
132125
9. Repeat from step 3 until :math:`\beta \ge 1`.
133126
10. The final result is a collection of N samples from the posterior.
134127

pymc/smc/smc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
class SMC_KERNEL(ABC):
4444
"""Base class for the Sequential Monte Carlo kernels
4545
46-
To creat a new SMC kernel you should subclass from this.
46+
To create a new SMC kernel you should subclass from this.
4747
4848
Before sampling, the following methods are called once in order:
4949

0 commit comments

Comments
 (0)