output_analysis.ReplicationTabulizer

Observer class for recording replication results from an

Usage

Source

output_analysis.ReplicationTabulizer()

OnlineStatistics instance during simulation runs or repeated experiments.

Implements the observer pattern to collect statistics after each update from the observed object, enabling later tabulation and analysis. After data collection, results can be exported as a summary dataframe (equivalent Implement as the part of observer pattern. Provides a summary frame to the output of confidence_interval_method).

Attributes

stdev: list[float]

Sequence of recorded standard deviations.

lower: list[float]

Sequence of recorded lower confidence interval bounds.

upper: list[float]

Sequence of recorded upper confidence interval bounds.

dev: list[float]

Sequence of recorded percentage deviations of CI half-width from the mean.

cumulative_mean: list[float]

Sequence of running mean values.

x_i: list[float]

Sequence of last observed raw data points.

n: int
Total number of updates recorded.

Methods

Name Description
__init__() Initialise an empty ReplicationTabulizer.
summary_table() Compile all recorded replications into a pandas DataFrame.
update() Record the latest statistics from an observed OnlineStatistics

__init__()

Initialise an empty ReplicationTabulizer.

Usage

Source

__init__()

All recorded metrics are stored in parallel lists, which grow as update() is called.


summary_table()

Compile all recorded replications into a pandas DataFrame.

Usage

Source

summary_table()
Returns
pandas.DataFrame
A table with one row per replication (update), containing:
  • Mean (latest observed value)
  • Cumulative Mean
  • Standard Deviation
  • Lower Interval
  • Upper Interval
  • % deviation (CI half-width as a fraction of cumulative mean)

update()

Record the latest statistics from an observed OnlineStatistics

Usage

Source

update(results)

instance.

This method should be called by the observed object when its state changes (i.e., when a new data point has been processed).

Parameters
results: OnlineStatistics
The current statistics object containing the latest values.