Class BennettAcceptanceRatio

java.lang.Object
ffx.numerics.estimator.SequentialEstimator
ffx.numerics.estimator.BennettAcceptanceRatio
All Implemented Interfaces:
BootstrappableEstimator, StatisticalEstimator

public class BennettAcceptanceRatio extends SequentialEstimator implements BootstrappableEstimator
The Bennett Acceptance Ratio class implements the Bennett Acceptance Ratio (BAR) statistical estimator, based on the Tinker implementation.

Literature References (from Tinker): C. H. Bennett, "Efficient Estimation of Free Energy Differences from Monte Carlo Data", Journal of Computational Physics, 22, 245-268 (1976)

M. A. Wyczalkowski, A. Vitalis and R. V. Pappu, "New Estimators for Calculating Solvation Entropy and Enthalpy and Comparative Assessments of Their Accuracy and Precision, Journal of Physical Chemistry, 114, 8166-8180 (2010) [modified BAR algorithm, non-implemented entropy/enthalpy]

K. B. Daly, J. B. Benziger, P. G. Debenedetti and A. Z. Panagiotopoulos, "Massively Parallel Chemical Potential Calculation on Graphics Processing Units", Computer Physics Communications, 183, 2054-2062 (2012) [non-implemented NPT modification]

Since:
1.0
Author:
Michael J. Schnieders, Jacob M. Litman
  • Constructor Details

    • BennettAcceptanceRatio

      public BennettAcceptanceRatio(double[] lambdaValues, double[][] eLambdaMinusdL, double[][] eLambda, double[][] eLambdaPlusdL, double[] temperature)
      Constructs a BAR estimator and obtains an initial free energy estimate.
      Parameters:
      lambdaValues - Value of lambda for each state.
      eLambdaMinusdL - Energies of state L samples at L+dL.
      eLambda - Energies of state L samples at L.
      eLambdaPlusdL - Energies of state L samples at L+dL.
      temperature - Temperature of each state.
    • BennettAcceptanceRatio

      public BennettAcceptanceRatio(double[] lambdaValues, double[][] eLambdaMinusdL, double[][] eLambda, double[][] eLambdaPlusdL, double[] temperature, double tolerance)
      Constructs a BAR estimator and obtains an initial free energy estimate.
      Parameters:
      lambdaValues - Value of lambda for each state.
      eLambdaMinusdL - Energies of state L samples at L+dL.
      eLambda - Energies of state L samples at L.
      eLambdaPlusdL - Energies of state L samples at L+dL.
      temperature - Temperature of each state.
      tolerance - Convergence criterion in kcal/mol for BAR iteration.
    • BennettAcceptanceRatio

      public BennettAcceptanceRatio(double[] lambdaValues, double[][] eLambdaMinusdL, double[][] eLambda, double[][] eLambdaPlusdL, double[] temperature, double tolerance, int nIterations)
      Constructs a BAR estimator and obtains an initial free energy estimate.
      Parameters:
      lambdaValues - Value of lambda for each state.
      eLambdaMinusdL - Energies of state L samples at L+dL.
      eLambda - Energies of state L samples at L.
      eLambdaPlusdL - Energies of state L samples at L+dL.
      temperature - Temperature of each state.
      tolerance - Convergence criterion in kcal/mol for BAR iteration.
      nIterations - Maximum number of iterations for BAR.
  • Method Details

    • getInitialBackwardsGuess

      public Zwanzig getInitialBackwardsGuess()
      Returns the backwards Zwanzig estimator used to seed BAR.
      Returns:
      A backwards Zwanzig estimator.
    • getInitialForwardsGuess

      public Zwanzig getInitialForwardsGuess()
      Returns the forwards Zwanzig estimator used to seed BAR.
      Returns:
      A forwards Zwanzig estimator.
    • copyEstimator

      public BennettAcceptanceRatio copyEstimator()
      Return a copy of this Estimator. Each implementation should specify its own type as the return type. Intended to make parallelization of bootstrapping easy.
      Specified by:
      copyEstimator in interface BootstrappableEstimator
      Returns:
      A copy of this Estimator.
    • estimateDG

      public final void estimateDG(boolean randomSamples)
      Main driver for estimation of BAR free energy differences.

      Based on Tinker implementation, which uses the substitution proposed in Wyczalkowski, Vitalis and Pappu 2010.

      Specified by:
      estimateDG in interface BootstrappableEstimator
      Parameters:
      randomSamples - Whether to use random sampling (for bootstrap analysis).
    • getFreeEnergyDifferences

      public double[] getFreeEnergyDifferences()
      Gets the free energy difference between each pair of states.
      Specified by:
      getFreeEnergyDifferences in interface StatisticalEstimator
      Returns:
      Array of free energy differences between states.
    • getFEDifferenceUncertainties

      public double[] getFEDifferenceUncertainties()
      Gets the uncertainty in free energy difference between each pair of states.
      Specified by:
      getFEDifferenceUncertainties in interface StatisticalEstimator
      Returns:
      Array of uncertainties in the free energy differences.
    • getTotalFreeEnergyDifference

      public double getTotalFreeEnergyDifference()
      Returns the total free energy difference between the first and last state.
      Specified by:
      getTotalFreeEnergyDifference in interface StatisticalEstimator
      Returns:
      Total free energy difference estimate.
    • getTotalFEDifferenceUncertainty

      public double getTotalFEDifferenceUncertainty()
      Returns the total uncertainty in the computed free energy difference between the first and last state.
      Specified by:
      getTotalFEDifferenceUncertainty in interface StatisticalEstimator
      Returns:
      Total uncertainty in the free energy difference.
    • getNumberOfBins

      public int getNumberOfBins()
      Returns the number of windows (BAR, etc), bins (WHAM, etc), or other sub-values used to compute the total free energy difference.
      Specified by:
      getNumberOfBins in interface StatisticalEstimator
      Returns:
      Total number of windows used to compute the total free energy difference.
    • getTotalEnthalpyDifference

      public double getTotalEnthalpyDifference()
      Gets the total enthalpy difference between the first and last state.
      Specified by:
      getTotalEnthalpyDifference in interface StatisticalEstimator
      Returns:
      The enthalpy difference between each pair of states.
    • getEnthalpyDifferences

      public double[] getEnthalpyDifferences()
      Gets the enthalpy change between each pair of states.
      Specified by:
      getEnthalpyDifferences in interface StatisticalEstimator
      Returns:
      The enthalpy difference between each pair of states.