Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions autofit/non_linear/search/mcmc/zeus/search.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
from typing import Dict, Optional

import numpy as np
Expand Down Expand Up @@ -292,6 +293,22 @@ def samples_via_internal_from(self, model, search_internal=None):
discard=discard, thin=thin, flat=True
)

if len(samples_after_burn_in) == 0:

logging.info(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a warning?

"""
After thinnng the Zeus samples in order to remove burn-in, no samples were left.

To create a samples object containing samples, so that the code can continue and results
can be inspected, the full list of samples before removing burn-in has been used. This may
indicate that the sampler has not converged and therefore your results may not be reliable.

To fix this, run Zeus with more steps to ensure convergence is achieved or change the auto
correlation settings to be less aggressive in thinning samples.
"""
)

samples_after_burn_in = search_internal.get_chain(flat=True)

parameter_lists = samples_after_burn_in.tolist()
log_posterior_list = search_internal.get_log_prob(flat=True).tolist()
Expand Down