Debian Codegraph @

docs/fes_with_pymbar.rst

raw
1 .. _fes_with_pymbar:
2
3 Free energy surfaces with pymbar
4 #################################
5
6 -------------------
7 Free energy surfces
8 -------------------
9
10 ``pymbar`` can be used to estimate free energy surfaces using samples
11 from *K* biased simulations. It is important to note that MBAR itself
12 is not enough to generate a free energy surface. MBAR takes a set of
13 samples from *K* different states, and can compute the weight that
14 should be given to each sample in in the unbiased state, i.e. the
15 state in which one desires to compute the free energy surface. Thus,
16 there can be no MBAR estimator of the free energy surface; that would
17 consist only in a set of weighted delta functions. This is done by
18 initializing the ``pymbar.FES`` class, which takes :math:`u_{kn}` and :math:`N_k`
19 matrices and passes them to MBAR.
20
21 The second step that needs to be carried out is to determine the best
22 approximation of the continuous function that the samples are
23 estimated from. ``pymbar.FES`` supports several methods to estimate
24 this continuous function. ``generate_fes``, given an initialized MBAR
25 object, a set of points, the energies at that point, and a method,
26 generates an object that contains the FES information. The current
27 options are ``histogram``, ``kde``, and spline. ``histogram`` behaves
28 as one might expect, creating a free energy surface as a histogram,
29 and refer to ``FES.rst`` for additional information. ``kde`` creates a
30 kernel density approximation, using the
31 ``sklearn.neighbors.KernelDensity function``, and parameters can be
32 passed to that function using the ``kde_parameters`` keyword.
33 Finally, the ``spline`` method uses a maximum likelhood approach to
34 calculate the spline most consistent with the input data, using the
35 formalism presented in Shirts et al. :cite:`shirts_fes_2020`. The ``spline``
36 functionality includes the ability to perform Monte Carlo sampling in
37 the spline parameters to generate confidence intervals for the points
38 in the spline curve.
39
40 ``histogram`` and ``kde`` methods can generate multidimesional free
41 energy surfaces, while ``splines`` for now is limited to a single free
42 energy surface.
43
44 The method `get_fes` return values of the free energy surface at the
45 specified coordinates, and when available, returns the uncertainties
46 in the values as well.
47
48 Examples `parallel-tempering-2d` and `umbrella-sampling` have been
49 rewnamed `parallel-tempering-2dfes and `umbrella-sampling` and
50 rewritten to demonstrate the new functionality.
51
52 .. autoclass:: pymbar.FES
53 :members: