Commit c32341cf authored by Marc Arene's avatar Marc Arene
Browse files

adding input optional parameters M,K to `autocorrelation_length_estimate`

parent b6a91b48
......@@ -12,8 +12,10 @@ except ModuleNotFoundError:
import emcee
with_emcee = True
print('WARNING: could not find `lalinference.bayespputils` module, thus using `emcee` module to compute the autocorrelation.')
except ModuleNotFoundError:
with_homemade = True
print('WARNING: could not find `lalinference.bayespputils` nor `emcee` modules, thus using homemade functions to compute the autocorrelation.')
# from lalinference.bayespputils import autocorrelation, autocorrelation_length_estimate
......@@ -21,9 +23,9 @@ if with_lalinf:
def autocorrelation(chain):
return lalinfbut.autocorrelation(chain)
def autocorrelation_length_estimate(chain):
def autocorrelation_length_estimate(chain, acf=None, M=5, K=2):
L = lalinfbut.autocorrelation_length_estimate(chain)
L = lalinfbut.autocorrelation_length_estimate(chain, acf=acf, M=M, K=K)
except lalinfbut.ACLError as e:
cut.logger.warning(f'Could not compute autocorrelation length on the chain for because of the following error:\n{e}\nHence returning L={len(chain)}')
L = len(chain)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment