Package ffx.numerics.estimator
Class Zwanzig
java.lang.Object
ffx.numerics.estimator.SequentialEstimator
ffx.numerics.estimator.Zwanzig
- All Implemented Interfaces:
BootstrappableEstimator
,StatisticalEstimator
The Zwanzig class implements exponential averaging/free energy perturbation using the Zwanzig
relationship, in either the forwards or backwards direction (not both).
- Since:
- 1.0
- Author:
- Michael J. Schnieders, Jacob M. Litman
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Directionality of the Zwanzig estimation (forwards perturbation or backwards perturbation). -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal Zwanzig.Directionality
Directionality of the Zwanzig estimation (forwards perturbation or backwards perturbation).Fields inherited from class ffx.numerics.estimator.SequentialEstimator
eAll, eAllFlat, eLambda, eLambdaMinusdL, eLambdaPlusdL, lamValues, nSamples, nStates, temperatures
-
Constructor Summary
ConstructorsConstructorDescriptionZwanzig
(double[] lambdaValues, double[][] eLambdaMinusdL, double[][] eLambda, double[][] eLambdaPlusdL, double[] temperature, Zwanzig.Directionality directionality) Estimates a free energy using the Zwanzig relationship. -
Method Summary
Modifier and TypeMethodDescriptionReturn a copy of this Estimator.final void
Re-calculates free energy and enthalpy without bootstrapping.final void
estimateDG
(boolean randomSamples) Re-calculates free energy and enthalpy.double[]
Gets the enthalpy change between each pair of states.double[]
Gets the uncertainty in free energy difference between each pair of states.double[]
Gets the free energy difference between each pair of states.int
Returns the number of windows (BAR, etc), bins (WHAM, etc), or other sub-values used to compute the total free energy difference.double
Gets the total enthalpy difference between the first and last state.double
Returns the total uncertainty in the computed free energy difference between the first and last state.double
Returns the total free energy difference between the first and last state.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ffx.numerics.estimator.BootstrappableEstimator
getTotalEnthalpyDifference, getTotalEnthalpyUncertainty, getTotalFEDifferenceUncertainty, getTotalFreeEnergyDifference
-
Field Details
-
directionality
Directionality of the Zwanzig estimation (forwards perturbation or backwards perturbation).
-
-
Constructor Details
-
Zwanzig
public Zwanzig(double[] lambdaValues, double[][] eLambdaMinusdL, double[][] eLambda, double[][] eLambdaPlusdL, double[] temperature, Zwanzig.Directionality directionality) Estimates a free energy using the Zwanzig relationship. 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/windows. The second dimension (can be of uneven length) corresponds to potential energies of snapshots sampled from that lambda value, calculated either at that lambda value, the lambda value below, or the lambda value above. The arrays eLambdaMinusdL[0] and eLambdaPlusdL[n-1] is expected to be all NaN.
- Parameters:
lambdaValues
- Lambda values for the samples.eLambdaMinusdL
- Potential energies of state L at lambda L-dL. Ignored for forwards FEP.eLambda
- Potential energies of state L at lambda L.eLambdaPlusdL
- Potential energies of state L at lambda L+dL. Ignored for backwards FEP.temperature
- Temperature each lambda window was run at (single-element indicates identical temperatures).directionality
- Forwards vs. backwards FEP.
-
-
Method Details
-
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 interfaceBootstrappableEstimator
- Returns:
- A copy of this Estimator.
-
estimateDG
public final void estimateDG(boolean randomSamples) Re-calculates free energy and enthalpy.- Specified by:
estimateDG
in interfaceBootstrappableEstimator
- Parameters:
randomSamples
- Whether to draw random samples with replacement (one bootstrap trial).
-
estimateDG
public final void estimateDG()Re-calculates free energy and enthalpy without bootstrapping.- Specified by:
estimateDG
in interfaceBootstrappableEstimator
-
getTotalFreeEnergyDifference
public double getTotalFreeEnergyDifference()Returns the total free energy difference between the first and last state.- Specified by:
getTotalFreeEnergyDifference
in interfaceStatisticalEstimator
- Returns:
- Total free energy difference estimate.
-
getFreeEnergyDifferences
public double[] getFreeEnergyDifferences()Gets the free energy difference between each pair of states.- Specified by:
getFreeEnergyDifferences
in interfaceStatisticalEstimator
- Returns:
- Array of free energy differences between states.
-
getTotalFEDifferenceUncertainty
public double getTotalFEDifferenceUncertainty()Returns the total uncertainty in the computed free energy difference between the first and last state.- Specified by:
getTotalFEDifferenceUncertainty
in interfaceStatisticalEstimator
- Returns:
- Total uncertainty in the free energy difference.
-
getFEDifferenceUncertainties
public double[] getFEDifferenceUncertainties()Gets the uncertainty in free energy difference between each pair of states.- Specified by:
getFEDifferenceUncertainties
in interfaceStatisticalEstimator
- Returns:
- Array of uncertainties in the free energy differences.
-
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 interfaceStatisticalEstimator
- 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 interfaceStatisticalEstimator
- 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 interfaceStatisticalEstimator
- Returns:
- The enthalpy difference between each pair of states.
-