Skip to content

Commit

Permalink
corrected do_block_analsysis to return uncertainty
Browse files Browse the repository at this point in the history
  • Loading branch information
pm-blanco committed Oct 31, 2021
1 parent dcc5054 commit 572ed3f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/python/espressomd/reaction_ensemble.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ cdef class WidomInsertion(ReactionAlgorithm):
"""
Performs a binning analysis of samples.
Divides the samples in ``N_blocks`` equispaced blocks
and returns the mean and the standard deviation between the blocks
and returns the mean and its uncertainty
"""
size_block = int(len(samples) / N_blocks)
block_list = []
Expand All @@ -663,8 +663,9 @@ cdef class WidomInsertion(ReactionAlgorithm):

sample_mean = np.mean(block_list)
sample_std = np.std(block_list, ddof=1)
sample_uncertainty = sample_std / np.sqrt(N_blocks)

return sample_mean, sample_std
return sample_mean, sample_uncertainty

gamma_samples = np.exp(-1.0 * np.array(
particle_insertion_potential_energy_samples) / self._params["kT"])
Expand Down

0 comments on commit 572ed3f

Please sign in to comment.