def __init__( self, model, sample_list=None, total_samples=10, log_evidence=0.0, number_live_points=5, time: Optional[float] = None, ): self.model = model if sample_list is None: sample_list = [ Sample( log_likelihood=log_likelihood, log_prior=0.0, weight=0.0 ) for log_likelihood in self.log_likelihood_list ] super().__init__( model=model, sample_list=sample_list, time=time ) self._total_samples = total_samples self._log_evidence = log_evidence self._number_live_points = number_live_points
def samples(self): if self._samples is not None: return self._samples return [ Sample(log_likelihood=log_likelihood, log_prior=0.0, weight=0.0) for log_likelihood in self.log_likelihood_list ]
def make_sample(): return Sample( log_likelihood=1.0, log_prior=1.0, weight=0.5, centre=1.0, intensity=2.0, sigma=3.0 )
def samples_with_log_likelihood_list( log_likelihood_list ): return [ Sample( log_likelihood=log_likelihood, log_prior=0, weight=0 ) for log_likelihood in log_likelihood_list ]
def default_sample_list(self): if self._log_likelihood_list is not None: log_likelihood_list = self._log_likelihood_list else: log_likelihood_list = range(3) return [ Sample( log_likelihood=log_likelihood, log_prior=0.0, weight=0.0 ) for log_likelihood in log_likelihood_list ]
def __init__( self, max_log_likelihood_instance=None, log_likelihoods=None, gaussian_tuples=None, ): if log_likelihoods is None: log_likelihoods = [1.0, 2.0, 3.0] super().__init__(model=None, samples=[ Sample(log_likelihood=log_likelihood, log_prior=0.0, weights=0.0) for log_likelihood in log_likelihoods ]) self._max_log_likelihood_instance = max_log_likelihood_instance self.gaussian_tuples = gaussian_tuples
def samples_with_log_likelihoods(log_likelihoods): return [ Sample(log_likelihood=log_likelihood, log_prior=0, weights=0) for log_likelihood in log_likelihoods ]