Commit c2e3e3d1 authored by Gregory Ashton's avatar Gregory Ashton

Make walker plots optional and add references

parent 6bbcc99d
Pipeline #22968 passed with stages
in 11 minutes and 10 seconds
......@@ -753,6 +753,8 @@ class Pymultinest(Sampler):
class Emcee(Sampler):
""" https://github.com/dfm/emcee """
def _run_external_sampler(self):
self.nwalkers = self.kwargs.pop('nwalkers', 100)
self.nsteps = self.kwargs.pop('nsteps', 100)
......@@ -775,7 +777,8 @@ class Emcee(Sampler):
self.result.walkers = sampler.chain[:, :, :]
self.result.log_evidence = np.nan
self.result.log_evidence_err = np.nan
self.plot_walkers()
if self.plot:
self.plot_walkers()
try:
logging.info("Max autocorr time = {}".format(
np.max(sampler.get_autocorr_time())))
......@@ -811,6 +814,7 @@ class Emcee(Sampler):
class Ptemcee(Emcee):
""" https://github.com/willvousden/ptemcee """
def _run_external_sampler(self):
self.ntemps = self.kwargs.pop('ntemps', 2)
......@@ -839,9 +843,12 @@ class Ptemcee(Emcee):
self.result.walkers = sampler.chain[0, :, :, :]
self.result.log_evidence = np.nan
self.result.log_evidence_err = np.nan
self.plot_walkers()
logging.info("Max autocorr time = {}".format(np.max(sampler.get_autocorr_time())))
logging.info("Tswap frac = {}".format(sampler.tswap_acceptance_fraction))
if self.plot:
self.plot_walkers()
logging.info("Max autocorr time = {}"
.format(np.max(sampler.get_autocorr_time())))
logging.info("Tswap frac = {}"
.format(sampler.tswap_acceptance_fraction))
return self.result
......
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