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
Modifier and TypeClassDescriptionstatic enum
Directionality of the Zwanzig estimation (forwards perturbation or backwards perturbation). -
Field Summary
Modifier and TypeFieldDescriptionfinal Zwanzig.Directionality
Directionality of the Zwanzig estimation (forwards perturbation or backwards perturbation).Fields inherited from class ffx.numerics.estimator.SequentialEstimator
eAll, eAllFlat, eAt, eHigh, eLow, lamValues, nTrajectories, snaps, temperatures
-
Constructor Summary
ConstructorDescriptionZwanzig
(double[] lambdaValues, double[][] energiesLow, double[][] energiesAt, double[][] energiesHigh, 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 free energy change per bin/window.double[]
Gets the enthalpy per bin/window.double[]
Gets the uncertainty in free energy associated with each bin/window.double
Returns the estimated free energy (usually in kcal/mol).double
Returns the uncertainty in the free energy estimate.int
Returns the number of windows (BAR, etc), bins (WHAM, etc), or other sub-values used to compute free energy.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
sumBootstrapEnthalpyUncertainty, sumBootstrapResults, sumBootstrapUncertainty, sumEnthalpyBootstrapResults
-
Field Details
-
directionality
Directionality of the Zwanzig estimation (forwards perturbation or backwards perturbation).
-
-
Constructor Details
-
Zwanzig
public Zwanzig(double[] lambdaValues, double[][] energiesLow, double[][] energiesAt, double[][] energiesHigh, 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 energiesLow[0] and energiesHigh[n-1] is expected to be all NaN.
- Parameters:
lambdaValues
- Values of lambda dynamics was run at.energiesLow
- Potential energies of trajectory L at lambda L-dL. Ignored for forwards FEP.energiesAt
- Potential energies of trajectory L at lambda L.energiesHigh
- Potential energies of trajectory 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
-
getBinEnergies
public double[] getBinEnergies()Gets the free energy change per bin/window.- Specified by:
getBinEnergies
in interfaceStatisticalEstimator
- Returns:
- Individual bin/window free energy changes.
-
getBinUncertainties
public double[] getBinUncertainties()Gets the uncertainty in free energy associated with each bin/window.- Specified by:
getBinUncertainties
in interfaceStatisticalEstimator
- Returns:
- Individual bin/window uncertainties.
-
getFreeEnergy
public double getFreeEnergy()Returns the estimated free energy (usually in kcal/mol).- Specified by:
getFreeEnergy
in interfaceStatisticalEstimator
- Returns:
- Free energy estimate.
-
getUncertainty
public double getUncertainty()Returns the uncertainty in the free energy estimate.- Specified by:
getUncertainty
in interfaceStatisticalEstimator
- Returns:
- Uncertainty in the free energy estimate.
-
numberOfBins
public int numberOfBins()Returns the number of windows (BAR, etc), bins (WHAM, etc), or other sub-values used to compute free energy.- Specified by:
numberOfBins
in interfaceStatisticalEstimator
- Returns:
- Total number of sub-values used to compute free energy.
-
getBinEnthalpies
public double[] getBinEnthalpies()Gets the enthalpy per bin/window.- Specified by:
getBinEnthalpies
in interfaceStatisticalEstimator
- Returns:
- Individual bin/window enthalpy.
-