Repository: eigenfoo/littlemcmc

Issue:
New commits to pymc3/step_methods/hmc/
> This is an auto-generated issue, triggered by the `even-with-pymc3` workflow.

There have been new commits to `pymc3/step_methods/hmc/` since yesterday: please see
[the latest run of the `even-with-pymc3` GitHub Action](https://github.com/eigenfoo/littlemcmc/actions?query=workflow%3Aeven-with-pymc3)
and consider if these commits are worth mirroring in `littlemcmc`.



Discussion:
codecov[bot]: # [Codecov](https://codecov.io/gh/eigenfoo/littlemcmc/pull/52?src=pr&el=h1) Report
> Merging [#52](https://codecov.io/gh/eigenfoo/littlemcmc/pull/52?src=pr&el=desc) into [master](https://codecov.io/gh/eigenfoo/littlemcmc/commit/0c75163e2afe5aff0cdcce17c60c7998d2ace91d&el=desc) will **increase** coverage by `0.68%`.
> The diff coverage is `100.00%`.

[![Impacted file tree graph](https://codecov.io/gh/eigenfoo/littlemcmc/pull/52/graphs/tree.svg?width=650&height=150&src=pr&token=7TboOy71MZ)](https://codecov.io/gh/eigenfoo/littlemcmc/pull/52?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master      #52      +/-   ##
==========================================
+ Coverage   82.58%   83.26%   +0.68%     
==========================================
  Files          14       14              
  Lines        1022     1028       +6     
==========================================
+ Hits          844      856      +12     
+ Misses        178      172       -6     
```


| [Impacted Files](https://codecov.io/gh/eigenfoo/littlemcmc/pull/52?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [littlemcmc/sampling.py](https://codecov.io/gh/eigenfoo/littlemcmc/pull/52/diff?src=pr&el=tree#diff-bGl0dGxlbWNtYy9zYW1wbGluZy5weQ==) | `87.12% <100.00%> (+10.04%)` | :arrow_up: |
| [tests/test\_sampling.py](https://codecov.io/gh/eigenfoo/littlemcmc/pull/52/diff?src=pr&el=tree#diff-dGVzdHMvdGVzdF9zYW1wbGluZy5weQ==) | `100.00% <100.00%> (ø)` | |
| [littlemcmc/base\_hmc.py](https://codecov.io/gh/eigenfoo/littlemcmc/pull/52/diff?src=pr&el=tree#diff-bGl0dGxlbWNtYy9iYXNlX2htYy5weQ==) | `75.00% <0.00%> (-3.58%)` | :arrow_down: |


Patch:
diff --git a/littlemcmc/sampling.py b/littlemcmc/sampling.py
index 2c13ed8..87d046a 100644
--- a/littlemcmc/sampling.py
+++ b/littlemcmc/sampling.py
@@ -248,8 +248,10 @@ def init_nuts(
           on the variance of the tuning samples.
         * jitter+adapt_diag : Same as `'adapt_diag'`, but use uniform jitter in [-1, 1]
           as starting point in each chain.
-        * adapt_full: Sample as `'adapt_diag'`, but adapts a dense mass matrix using the
+        * adapt_full: Same as `'adapt_diag'`, but adapts a dense mass matrix using the
           sample covariances.
+        * jitter+adapt_full: Same as `'adapt_full'`, but use uniform jitter in [-1, 1]
+          as starting point in each chain.
     **kwargs: keyword arguments
         Extra keyword arguments are forwarded to littlemcmc.NUTS.
 
@@ -290,6 +292,11 @@ def init_nuts(
         mean = start
         cov = np.eye(size)
         potential = QuadPotentialFullAdapt(size, mean, cov, 10)
+    elif init == "jitter+adapt_full":
+        start = 2 * np.random.rand(size) - 1
+        mean = start
+        cov = np.eye(size)
+        potential = QuadPotentialFullAdapt(size, mean, cov, 10)
     else:
         raise ValueError("Unknown initializer: {}.".format(init))
 
diff --git a/requirements-dev.txt b/requirements-dev.txt
index abd5ec6..8cae25b 100644
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -1,3 +1,4 @@
+# Development tools
 black
 jupyter
 mypy
@@ -10,7 +11,6 @@ pytest-html
 # Packaging requirements
 setuptools
 twine
-wheel
 
 # Sphinx requirements
 numpydoc
diff --git a/requirements.txt b/requirements.txt
index 5fcd45a..e48c91e 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,4 @@
+wheel
 joblib>=0.14.1
 numpy
 scipy>=0.18.1


Test patch:
diff --git a/tests/test_sampling.py b/tests/test_sampling.py
index 1892c73..d47e49f 100644
--- a/tests/test_sampling.py
+++ b/tests/test_sampling.py
@@ -13,17 +13,19 @@
 #  limitations under the License.
 
 import numpy as np
+import pytest
 import littlemcmc as lmc
 from test_utils import logp_dlogp_func
 
 
-def test_init_nuts():
-    size = 1
-    init = "auto"
-    random_seed = 42
-    foo = lmc.init_nuts(
-        logp_dlogp_func=logp_dlogp_func, size=size, init=init, random_seed=random_seed,
-    )
+@pytest.mark.parametrize(
+    "method", ["adapt_diag", "jitter+adapt_diag", "adapt_full", "jitter+adapt_full",],
+)
+def test_init_nuts(method):
+    start, step = lmc.init_nuts(logp_dlogp_func=logp_dlogp_func, size=1, init=method)
+    assert isinstance(start, np.ndarray)
+    assert len(start) == 1
+    assert isinstance(step, lmc.NUTS)
 
 
 def test_hmc_sampling_runs():