Class SequentialEstimator

java.lang.Object
ffx.numerics.estimator.SequentialEstimator
All Implemented Interfaces:
StatisticalEstimator
Direct Known Subclasses:
BennettAcceptanceRatio, MultistateBennettAcceptanceRatio, Zwanzig

public abstract class SequentialEstimator extends Object implements StatisticalEstimator
The SequentialEstimator abstract class defines a statistical estimator based on perturbative potential energy differences between adjacent windows (e.g. exponential free energy perturbation, Bennett Acceptance Ratio, etc).
Since:
1.0
Author:
Michael J. Schnieders, Jacob M. Litman, Matthew J. Speranza
  • Field Details

    • lamValues

      protected final double[] lamValues
      The lambda values at which the samples were collected.
    • nStates

      protected final int nStates
      The number of states from which samples were collected.
    • eLambdaMinusdL

      protected final double[][] eLambdaMinusdL
      The potential energy of each snapshot at lambda - dL.
    • eLambda

      protected final double[][] eLambda
      The potential energy of each snapshot at lambda.
    • eLambdaPlusdL

      protected final double[][] eLambdaPlusdL
      The potential energy of each snapshot at lambda + dL.
    • eAll

      protected final double[][][] eAll
      The potential energies of the snapshots at all other lambda values.

      eAll[lambdaWindow][perturbations][energies]

    • eAllFlat

      protected double[][] eAllFlat
      The potential energies of the snapshots at all other lambda values.

      eAllFlat[lambda][evaluationsAtThisLambdaFromAllOtherLambda]

    • nSamples

      protected int[] nSamples
      The number of samples for each lambda state.
    • temperatures

      protected final double[] temperatures
      The temperatures at which the samples were collected.
  • Constructor Details

    • SequentialEstimator

      public SequentialEstimator(double[] lambdaValues, double[][] eLambdaMinusdL, double[][] eLambda, double[][] eLambdaPlusdL, double[] temperature)
      The SequentialEstimator constructor largely just copies its parameters into local variables. Most arrays are duplicated (rather a just copying their reference). The temperature array can be of length 1 if all elements are meant to be the same temperature.

      The first dimension of the energies arrays corresponds to the lambda values. The second dimension (can be of uneven length) corresponds to potential energies of snapshots sampled at that lambda value, calculated either at that lambda value, the lambda value below, or the lambda value above. The arrays eLambdaMindL[0] and eLambdaPlusdL[n-1] is expected to be all NaN.

      Parameters:
      lambdaValues - Values of lambda for sampled states.
      eLambdaMinusdL - Potential energies of state L at L-dL.
      eLambda - Potential energies of state L at L.
      eLambdaPlusdL - Potential energies of state L at L+dL.
      temperature - Temperature each state (single-element for a constant temperature).
    • SequentialEstimator

      public SequentialEstimator(double[] lambdaValues, double[][][] energiesAll, double[] temperature)
      The SequentialEstimator constructor largely just copies its parameters into local variables. Most arrays are duplicated (rather a just copying their reference). The temperature array can be of length 1 if all elements are meant to be the same temperature.

      This constructor is meant for lower variance estimators such as MBAR and WHAM. These methods require energy evaluations from all lambda windows at all lambda values. The energiesAll array is expected to be of the form energiesAll[lambdaWindow][windowPerspective][lambdaWindowSnapshotPerspectiveEnergy]. As an example, at the 3rd lambda window, the energiesAll[2] array should contain the energies of all the snapshots from the 3rd lambda window evaluated at all lambda values. energiesAll[2][3] is a list of all snapshots from lambda 3 evaluated with the potential of lambda 4. energiesAll[2][3][4] is the 5th snapshot from lambda 3 evaluated with the potential of lambda 4.

      This constructor also breaks energiesAll into a flattened array (across the second dimension) such that the first dimension is the lambda window where the energy was evaluated and the second dimension is the snaps. energiesAll is also broken down into eAt, eLow, and eHigh arrays for convenience and so that BAR calculations can be performed and compared.

      Parameters:
      lambdaValues - Values of lambda dynamics was run at.
      energiesAll - Potential energy of each sample at all other lambdas. (Missing states are NaN)
      temperature - Temperature each state (single-element for a constant temperature).
    • SequentialEstimator

      public SequentialEstimator(double[] lambdaValues, int[] nSamples, double[][] eAllFlat, double[] temperature)
      Simpler constructor for when data provided is already flattened (although it adds uncertainty about snap counts, they are all set to the same number).
      Parameters:
      lambdaValues - Lambda values.
      nSamples - Number of samples for each state.
      eAllFlat - Flattened energy evaluations at all lambda values.
      temperature - Temperature each state (single-element for a constant temperature).