rexfw.statistics.averages module

Classes representing runtime-averages of quantities such as acceptance rates

class rexfw.statistics.averages.AbstractAverage(origins, stats_fields, name, variable_name=None)[source]

Bases: rexfw.statistics.logged_quantities.LoggedQuantity

_calculate_new_value(info)[source]

Calculates a new average value from the information given in info

_get_value(stats)

Retrieves a value for the logged quantity from a small sampling statistics object

Parameters:stats (dict) – dict of the form {variable_name: SamplingStats}
current_value

Returns the current (last) value of the logged quantity

update(step, stats)[source]

Stores sampling statistics for a given step

Parameters:
  • step (int) – the sampling step during which the statistics in stats where created
  • stats (dict) – dict of the form {variable_name: SamplingStats}
values

Returns all stored values of the logged quantity

class rexfw.statistics.averages.MCMCAcceptanceRateAverage(replica, variable_name)[source]

Bases: rexfw.statistics.averages.AbstractAverage

_calculate_new_value(stats)[source]

Calculates a new average value from the information given in info

_get_value(stats)

Retrieves a value for the logged quantity from a small sampling statistics object

Parameters:stats (dict) – dict of the form {variable_name: SamplingStats}
current_value

Returns the current (last) value of the logged quantity

update(step, stats)

Stores sampling statistics for a given step

Parameters:
  • step (int) – the sampling step during which the statistics in stats where created
  • stats (dict) – dict of the form {variable_name: SamplingStats}
values

Returns all stored values of the logged quantity

class rexfw.statistics.averages.REAcceptanceRateAverage(replica1, replica2)[source]

Bases: rexfw.statistics.averages.AbstractAverage

_calculate_new_value(stats)[source]

Calculates a new average value from the information given in info

_get_value(stats)

Retrieves a value for the logged quantity from a small sampling statistics object

Parameters:stats (dict) – dict of the form {variable_name: SamplingStats}
current_value

Returns the current (last) value of the logged quantity

update(step, stats)

Stores sampling statistics for a given step

Parameters:
  • step (int) – the sampling step during which the statistics in stats where created
  • stats (dict) – dict of the form {variable_name: SamplingStats}
values

Returns all stored values of the logged quantity