a3fe.analyse.compare

Functionality for comparing two or more simulation runners.

Functions

compare_variances_brown_forsythe(sim_runners)

Compare the variances of the free energies of two simulation runners using the Brown-Forsythe test.

get_comparitive_convergence_data(sim_runners)

Get the convergence of multiple simulation runners against each other.

a3fe.analyse.compare.compare_variances_brown_forsythe(sim_runners: SimulationRunnerIterator) float[source]

Compare the variances of the free energies of two simulation runners using the Brown-Forsythe test.

Parameters:

sim_runners (SimulationRunnerIterator) – An iterator of two simulation runners to compare.

Returns:

The p-value of the Brown-Forsythe test.

Return type:

float

a3fe.analyse.compare.get_comparitive_convergence_data(sim_runners: SimulationRunnerIterator, equilibrated: bool = False, mode: str = 'cumulative') List[Tuple[ndarray, ndarray]][source]

Get the convergence of multiple simulation runners against each other. The maximum time used for the comparison is taken from the shortest simulation runner.

Parameters:
  • sim_runners (SimulationRunnerIterator) – An iterator of simulation runners to compare.

  • equilibrated (bool, default: False) – Whether to use the equilibrated simulation time or the total simulation time. If False, all simulation data will be used, otherwise only the equilibrated data will be used.

  • mode (str, optional, default=”cumulative”) – “cumulative” or “block”. The type of averaging to use. In both cases, 20 MBAR evaluations are performed per simulation runner.

Returns:

A tuple of tuples of the convergence of each simulation runner. For each simulation runner, the first array is the total simulation time plotted, and the second array is the corresponding average free energy change for each value of total equilibrated simtime for each of the ensemble size repeats.

Return type:

List[Tuple[np.ndarray, np.ndarray], …]