BAR
The BAR estimator is a light wrapper around the implementation of the Bennett Acceptance Ratio (BAR) method [Bennett1976] from pymbar (pymbar.other_estimators.bar()).
It uses information from neighboring sampled states to generate an estimate for the free energy difference between these state.
See also
API Reference
- class alchemlyb.estimators.BAR(maximum_iterations: int = 10000, relative_tolerance: float = 1e-07, method: str = 'false-position', verbose: bool = False)[source]
Bennett acceptance ratio (BAR).
- Parameters:
maximum_iterations (int, optional) – Set to limit the maximum number of iterations performed.
relative_tolerance (float, optional) – Set to determine the relative tolerance convergence criteria.
method (str, optional, default='false-position') – choice of method to solve BAR nonlinear equations, one of ‘self-consistent-iteration’ or ‘false-position’ (default: ‘false-position’)
verbose (bool, optional) – Set to True if verbose debug output is desired.
- delta_f_
The estimated dimensionless free energy difference between each state.
- Type:
DataFrame
- d_delta_f_
The estimated statistical uncertainty (one standard deviation) in dimensionless free energy differences.
- Type:
DataFrame
Notes
See [Bennett1976] for details of the derivation and cite the paper (together with [Shirts2008] for the Python implementation in
pymbar) when using BAR in published work.When possible, use MBAR instead of BAR as it makes better use of the available data.
See also
Changed in version 1.0.0: delta_f_, d_delta_f_, states_ are view of the original object.
Changed in version 2.4.0: Added assessment of lambda states represented in the indices of u_nk to provide meaningful errors to ensure proper use.
- __init__(maximum_iterations: int = 10000, relative_tolerance: float = 1e-07, method: str = 'false-position', verbose: bool = False) None[source]
- fit(u_nk: DataFrame) BAR[source]
Compute overlap matrix of reduced potentials using Bennett acceptance ratio.
- Parameters:
u_nk (DataFrame) – u_nk[n,k] is the reduced potential energy of uncorrelated configuration n evaluated at state k.
- classmethod __init_subclass__(**kwargs)
Set the
set_{method}_requestmethods.This uses PEP-487 [1] to set the
set_{method}_requestmethods. It looks for the information available in the set default values which are set using__metadata_request__*class attributes, or inferred from method signatures.The
__metadata_request__*class attributes are used when a method does not explicitly accept a metadata through its arguments or if the developer would like to specify a request value for those metadata which are different from the defaultNone.References
- get_metadata_routing()
Get metadata routing of this object.
Please check User Guide on how the routing mechanism works.
- Returns:
routing – A
MetadataRequestencapsulating routing information.- Return type:
MetadataRequest
- get_params(deep=True)
Get parameters for this estimator.
- set_fit_request(*, u_nk: bool | None | str = '$UNCHANGED$') BAR
Configure whether metadata should be requested to be passed to the
fitmethod.Note that this method is only relevant when this estimator is used as a sub-estimator within a meta-estimator and metadata routing is enabled with
enable_metadata_routing=True(seesklearn.set_config()). Please check the User Guide on how the routing mechanism works.The options for each parameter are:
True: metadata is requested, and passed tofitif provided. The request is ignored if metadata is not provided.False: metadata is not requested and the meta-estimator will not pass it tofit.None: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED) retains the existing request. This allows you to change the request for some parameters and not others.Added in version 1.3.
- set_params(**params)
Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects (such as
Pipeline). The latter have parameters of the form<component>__<parameter>so that it’s possible to update each component of a nested object.- Parameters:
**params (dict) – Estimator parameters.
- Returns:
self – Estimator instance.
- Return type:
estimator instance