question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AutocorrError, 'The chain is too short to reliably estimate the autocorrelation time'

See original GitHub issue

I’ve been using emcee without any problems for a while. Recently I tried running my program in Windows10, but I get an error with the autocorr (that I didn’t get before). Using the quickstart.py example I get the same problem but I can’t figure out whats wrong whatsoever. I hope you can help me figuring out whats wrong . This is the log I get running quickstart.py :

In [1]: run quickstart.py
Mean acceptance fraction: 0.191032
---------------------------------------------------------------------------
AutocorrError                             Traceback (most recent call last)
C:\Users\anibal\Documents\GitHub\emcee\examples\quickstart.py in <module>()
     58 # Estimate the integrated autocorrelation time for the time series in each
     59 # parameter.
---> 60 print("Autocorrelation time:", sampler.get_autocorr_time())
     61
     62 # Finally, you can plot the projected histograms of the samples using

C:\Users\anibal\Anaconda2\lib\site-packages\emcee-2.2.1-py2.7.egg\emcee\ensemble.pyc in get_autocorr_time(self, low, high, step, c, fast)
    501         return autocorr.integrated_time(np.mean(self.chain, axis=0), axis=0,
    502                                         low=low, high=high, step=step, c=c,
--> 503                                         fast=fast)
    504
    505

C:\Users\anibal\Anaconda2\lib\site-packages\emcee-2.2.1-py2.7.egg\emcee\autocorr.pyc in integrated_time(x, low, high, step, c, full_output, axis, fast)
    116             break
    117
--> 118     raise AutocorrError("The chain is too short to reliably estimate "
    119                         "the autocorrelation time")
    120

AutocorrError: The chain is too short to reliably estimate the autocorrelation time

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
dfmcommented, Nov 20, 2016

The most recent version of emcee has a more robust autocorrelation time estimator so I reduced the dimensionality of the quickstart example and ran more steps of MCMC. This error won’t be thrown for the example now and, if you’re finding it with your own code, that means that your chains probably haven’t converged! If you must, you can reduce the c parameter to a smaller value but the estimate won’t be as reliable so be careful.

0reactions
dfmcommented, Nov 8, 2019

@deltasata: you need to update emcee (to >3) or follow the old docs. Python 2.7 is no longer officially supported for emcee v3 however.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Autocorrelation Analysis - emcee - Read the Docs
AutocorrError: If the autocorrelation time can't be reliably estimated. from the chain and quiet is False . This normally means that the chain...
Read more >
How to use the emcee.autocorr function in emcee - Snyk
AutocorrError : autocorr = [np.nan, np.nan, np.nan] print('The chain is too short to reliably estimate the autocorrelation time.
Read more >
Autocorrelation time in emcee
Both approaches to estimate the autocorrelation time are compared to ... for emcee, whose chains/walkers are not independent like in HMC.
Read more >
Autocorrelation time estimation | Dan Foreman-Mackey
but, since the integrated autocorrelation time directly ... In this case, this estimate seems to be robust even for very short chains with ......
Read more >
emcee Documentation - Read the Docs
AutocorrError : If the autocorrelation time can't be reliably estimated from the chain. This normally means that the chain is too short.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found