fix: fixes bug with clamped probabilities being underestimated

This commit is contained in:
2023-07-27 17:05:33 -05:00
parent 33d5da6a4f
commit e6defc7948

View File

@@ -153,7 +153,9 @@ class SubsetSimulation:
for seed_index, (c, s) in enumerate(next_seeds): for seed_index, (c, s) in enumerate(next_seeds):
# chain = mcmc(s, threshold_cost, n_s, model, dot_inputs_array, actual_measurement_array, mcmc_rng, curr_cost=c, stdevs=stdevs) # chain = mcmc(s, threshold_cost, n_s, model, dot_inputs_array, actual_measurement_array, mcmc_rng, curr_cost=c, stdevs=stdevs)
# until new version gotta do # until new version gotta do
_logger.debug(f"\t{seed_index}: getting another chain from the next seed") _logger.debug(
f"\t{seed_index}: getting another chain from the next seed"
)
chain = self.model.get_mcmc_chain( chain = self.model.get_mcmc_chain(
s, s,
self.cost_function_to_use, self.cost_function_to_use,
@@ -242,7 +244,7 @@ class SubsetSimulation:
# _logger.info(f"\t{prob}: {prob_cost}") # _logger.info(f"\t{prob}: {prob_cost}")
probs_list.sort(key=lambda c: c[0], reverse=True) probs_list.sort(key=lambda c: c[0], reverse=True)
min_likelihood = ((1) / (self.n_c * self.n_s)) / (self.n_s ** (self.m_max + 1)) min_likelihood = ((1) / (self.n_c * self.n_s)) / (self.n_s ** (self.m_max))
result = SubsetSimulationResult( result = SubsetSimulationResult(
probs_list=probs_list, probs_list=probs_list,