Skip to content

Commit e9d7d5a

Browse files
committed
Fix documentation errors (blackjax-devs#158)
* Add requirements files for documentation * Fix references in documentation
1 parent 4825447 commit e9d7d5a

File tree

4 files changed

+24
-17
lines changed

4 files changed

+24
-17
lines changed

.github/workflows/build_doc.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
- name: Build docs
2323
run: |
24-
pip install -r requirements-dev.txt
24+
pip install -r requirements-doc.txt
2525
sphinx-build -b html docs docs/build/html
2626
2727
- name: Publish docs

blackjax/adaptation/step_size.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -74,21 +74,21 @@ def dual_averaging_adaptation(
7474
:math:`h(\\overline{x}_t)` converges to 0, i.e. the Metropolis acceptance
7575
rate converges to the desired rate.
7676
77-
See reference [Hoffman2014]_ (section 3.2.1) for a detailed discussion.
77+
See reference [Hoffman2014a]_ (section 3.2.1) for a detailed discussion.
7878
7979
Parameters
8080
----------
8181
t0: float >= 0
8282
Free parameter that stabilizes the initial iterations of the algorithm.
83-
Large values may slow down convergence. Introduced in [Hoffman2014]_ with a default
83+
Large values may slow down convergence. Introduced in [Hoffman2014a]_ with a default
8484
value of 10.
8585
gamma:
86-
Controls the speed of convergence of the scheme. The authors of [Hoffman2014]_ recommend
86+
Controls the speed of convergence of the scheme. The authors of [Hoffman2014a]_ recommend
8787
a value of 0.05.
8888
kappa: float in ]0.5, 1]
8989
Controls the weights of past steps in the current update. The scheme will
9090
quickly forget earlier step for a small value of `kappa`. Introduced
91-
in [Hoffman2014]_, with a recommended value of .75
91+
in [Hoffman2014a]_, with a recommended value of .75
9292
target:
9393
Target acceptance rate.
9494
@@ -104,7 +104,7 @@ def dual_averaging_adaptation(
104104
105105
.. [Nesterov2009] Nesterov, Yurii. "Primal-dual subgradient methods for convex
106106
problems." Mathematical programming 120.1 (2009): 221-259.
107-
.. [Hoffman2014] Hoffman, Matthew D., and Andrew Gelman. "The No-U-Turn sampler:
107+
.. [Hoffman2014a] Hoffman, Matthew D., and Andrew Gelman. "The No-U-Turn sampler:
108108
adaptively setting path lengths in Hamiltonian Monte Carlo." Journal
109109
of Machine Learning Research 15.1 (2014): 1593-1623.
110110
"""
@@ -183,7 +183,7 @@ def find_reasonable_step_size(
183183
value for the step size starting from any value, choosing a good first
184184
value can speed up the convergence. This heuristics doubles and halves the
185185
step size until the acceptance probability of the HMC proposal crosses the
186-
target value [Hoffman2014]_.
186+
target value [Hoffman2014b]_.
187187
188188
Parameters
189189
----------
@@ -210,7 +210,7 @@ def find_reasonable_step_size(
210210
211211
References
212212
----------
213-
.. [Hoffman2014] Hoffman, Matthew D., and Andrew Gelman. "The No-U-Turn sampler:
213+
.. [Hoffman2014b] Hoffman, Matthew D., and Andrew Gelman. "The No-U-Turn sampler:
214214
adaptively setting path lengths in Hamiltonian Monte Carlo." Journal
215215
of Machine Learning Research 15.1 (2014): 1593-1623.
216216

blackjax/diagnostics.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ def potential_scale_reduction(
3737
where :math:`W` is the within-chain variance and :math:`\\hat{V}` is the posterior variance
3838
estimate for the pooled traces. This is the potential scale reduction factor, which
3939
converges to unity when each of the traces is a sample from the target posterior. Values
40-
greater than one indicate that one or more chains have not yet converged.
40+
greater than one indicate that one or more chains have not yet converged [StanRhat]_ [Gelman1992]_.
4141
4242
References
4343
----------
44-
.. [1] https://mc-stan.org/docs/2_27/reference-manual/notation-for-samples-chains-and-draws.html#potential-scale-reduction
45-
.. [2] Gelman, Andrew, and Donald B. Rubin. (1992) “Inference from Iterative Simulation Using Multiple Sequences.” Statistical Science 7 (4): 457–72.
44+
.. [StanRhat] https://mc-stan.org/docs/2_27/reference-manual/notation-for-samples-chains-and-draws.html#potential-scale-reduction
45+
.. [Gelman1992] Gelman, Andrew, and Donald B. Rubin. (1992) “Inference from Iterative Simulation Using Multiple Sequences.” Statistical Science 7 (4): 457–72.
4646
4747
"""
4848
assert (
@@ -97,17 +97,17 @@ def effective_sample_size(
9797
where :math:`M` is the number of chains, :math:`N` the number of draws,
9898
:math:`\\hat{\\rho}_t` is the estimated _autocorrelation at lag :math:`t`, and
9999
:math:`K` is the last integer for which :math:`\\hat{P}_{K} = \\hat{\\rho}_{2K} +
100-
\\hat{\\rho}_{2K+1}` is still positive.
100+
\\hat{\\rho}_{2K+1}` is still positive [StanEff]_ [Gelman2013]_.
101101
102102
The current implementation is similar to Stan, which uses Geyer's initial monotone sequence
103-
criterion (Geyer, 1992; Geyer, 2011).
103+
criterion [Geyer1992]_ [Geyer2011]_.
104104
105105
References
106106
----------
107-
.. [1] https://mc-stan.org/docs/2_27/reference-manual/effective-sample-size-section.html
108-
.. [2] Gelman, Andrew, J. B. Carlin, Hal S. Stern, David B. Dunson, Aki Vehtari, and Donald B. Rubin. (2013). Bayesian Data Analysis. Third Edition. Chapman; Hall/CRC.
109-
.. [3] Geyer, Charles J. (1992). “Practical Markov Chain Monte Carlo.” Statistical Science, 473–83.
110-
.. [4] Geyer, Charles J. (2011). “Introduction to Markov Chain Monte Carlo.” In Handbook of Markov Chain Monte Carlo, edited by Steve Brooks, Andrew Gelman, Galin L. Jones, and Xiao-Li Meng, 3–48. Chapman; Hall/CRC.
107+
.. [StanEff] https://mc-stan.org/docs/2_27/reference-manual/effective-sample-size-section.html
108+
.. [Gelman2013] Gelman, Andrew, J. B. Carlin, Hal S. Stern, David B. Dunson, Aki Vehtari, and Donald B. Rubin. (2013). Bayesian Data Analysis. Third Edition. Chapman; Hall/CRC.
109+
.. [Geyer1992] Geyer, Charles J. (1992). “Practical Markov Chain Monte Carlo.” Statistical Science, 473–83.
110+
.. [Geyer2011] Geyer, Charles J. (2011). “Introduction to Markov Chain Monte Carlo.” In Handbook of Markov Chain Monte Carlo, edited by Steve Brooks, Andrew Gelman, Galin L. Jones, and Xiao-Li Meng, 3–48. Chapman; Hall/CRC.
111111
112112
"""
113113
input_shape = input_array.shape

requirements-doc.txt

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
-e ./
2+
jax
3+
jaxlib
4+
myst_nb
5+
sphinx
6+
sphinx-autobuild
7+
sphinx-book-theme

0 commit comments

Comments
 (0)