You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the ensemble over walkers and computing the autocorrelation function of
291
291
the mean chain to lower the variance of the estimator and that was what
292
292
was originally implemented in emcee. Since then, @fardal on GitHub
293
293
`suggested that other estimators might have lower
294
294
variance <https://github.com/dfm/emcee/issues/209>`__. This is
295
295
absolutely correct and, instead of the Goodman & Weare method, we now
296
-
recommend computing the autocorrelation time for each walker (it’s
296
+
recommend computing the autocorrelation time for each walker (it's
297
297
actually possible to still use the ensemble to choose the appropriate
298
298
window) and then average these estimates.
299
299
@@ -357,16 +357,16 @@ fact, even for moderately long chains, the old method can give
357
357
dangerously over-confident estimates. For comparison, we have also
358
358
plotted the :math:`\tau = N/50` line to show that, once the estimate
359
359
crosses that line, The estimates are starting to get more reasonable.
360
-
This suggests that you probably shouldn’t trust any estimate of
360
+
This suggests that you probably shouldn't trust any estimate of
361
361
:math:`\tau` unless you have more than :math:`F\times\tau` samples for
362
362
some :math:`F \ge50`. Larger values of :math:`F` will be more
363
363
conservative, but they will also (obviously) require longer chains.
364
364
365
365
A more realistic example
366
366
------------------------
367
367
368
-
Now, let’s run an actual Markov chain and test these methods using those
369
-
samples. So that the sampling isn’t completely trivial, we’ll sample a
368
+
Now, let's run an actual Markov chain and test these methods using those
369
+
samples. So that the sampling isn't completely trivial, we'll sample a
370
370
multimodal density in three dimensions.
371
371
372
372
.. code:: python
@@ -384,12 +384,10 @@ multimodal density in three dimensions.
384
384
385
385
.. parsed-literal::
386
386
387
-
/Users/dforeman/anaconda/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
388
-
from ._conv import register_converters as _register_converters
Here’s the marginalized density in the first dimension.
390
+
Here's the marginalized density in the first dimension.
393
391
394
392
.. code:: python
395
393
@@ -405,7 +403,7 @@ Here’s the marginalized density in the first dimension.
405
403
.. image:: autocorr_files/autocorr_16_0.png
406
404
407
405
408
-
And here’s the comparison plot showing how the autocorrelation time
406
+
And here's the comparison plot showing how the autocorrelation time
409
407
estimates converge with longer chains.
410
408
411
409
.. code:: python
@@ -449,11 +447,11 @@ fit an `autoregressive
449
447
model <https://en.wikipedia.org/wiki/Autoregressive_model>`__ to the
450
448
chain and using that to estimate the autocorrelation time.
451
449
452
-
As an example, we’ll use `celerite <http://celerite.readthdocs.io>`__ to
450
+
As an example, we'll use `celerite <http://celerite.readthdocs.io>`__ to
453
451
fit for the maximum likelihood autocorrelation function and then compute
454
452
an estimate of :math:`\tau` based on that model. The celerite model that
455
-
we’re using is equivalent to a second-order ARMA model and it appears to
456
-
be a good choice for this example, but we’re not going to promise
453
+
we're using is equivalent to a second-order ARMA model and it appears to
454
+
be a good choice for this example, but we're not going to promise
457
455
anything here about the general applicability and we caution care
458
456
whenever estimating autocorrelation times using short chains.
459
457
@@ -509,6 +507,13 @@ whenever estimating autocorrelation times using short chains.
509
507
thin =max(1, int(0.05*new[i]))
510
508
ml[i] = autocorr_ml(chain[:, :n], thin=thin)
511
509
510
+
511
+
.. parsed-literal::
512
+
513
+
/Users/dforeman/anaconda3/lib/python3.6/site-packages/autograd/numpy/numpy_vjps.py:444: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
514
+
return lambda g: g[idxs]
515
+
516
+
512
517
.. code:: python
513
518
514
519
# Plot the comparisons
@@ -523,17 +528,11 @@ whenever estimating autocorrelation times using short chains.
523
528
plt.legend(fontsize=14);
524
529
525
530
526
-
.. parsed-literal::
527
-
528
-
/Users/dforeman/anaconda/lib/python3.6/site-packages/matplotlib/scale.py:114: RuntimeWarning: invalid value encountered in less_equal
529
-
out[a <= 0] = -1000
530
-
531
-
532
531
533
-
.. image:: autocorr_files/autocorr_22_1.png
532
+
.. image:: autocorr_files/autocorr_22_0.png
534
533
535
534
536
-
This figure is the same as the previous one, but we’ve added the maximum
535
+
This figure is the same as the previous one, but we've added the maximum
537
536
likelihood estimates for :math:`\tau` in green. In this case, this
538
537
estimate seems to be robust even for very short chains with
0 commit comments