Skip to content

Commit

Permalink
Merge pull request #270 from choderalab/quickdocfix
Browse files Browse the repository at this point in the history
Doc updates for 3.0.3
  • Loading branch information
Lnaden committed Jul 24, 2017
2 parents 82ad9f0 + 268c9b9 commit ac648e6
Show file tree
Hide file tree
Showing 6 changed files with 200 additions and 132 deletions.
9 changes: 4 additions & 5 deletions devtools/conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
package:
name: pymbar-dev
version: !!str 3.0.1.dev0
version: !!str 3.0.3.dev0

source:
path: ../../

requirements:
build:
- python
- numpy
- scipy
- setuptools
- numexpr
- six
- numpy x.x
- toolchain
run:
- python
- numpy
- numpy x.x
- scipy
- numexpr
- six
Expand Down
12 changes: 6 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@

# General information about the project.
project = u'pymbar'
copyright = u'2014, John D. Chodera, Michael Shirts, Kyle A. Beauchamp'
copyright = u'2017, John D. Chodera, Michael Shirts, Kyle A. Beauchamp, Levi N. Naden'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand All @@ -84,8 +84,8 @@
#release = version

# The full version, including alpha/beta/rc tags.
version = '2.1.0'
release = '2.1.0'
version = '3.0.3'
release = '3.0.3'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -254,7 +254,7 @@
# author, documentclass [howto, manual, or own class]).
latex_documents = [
('index', 'pymbar.tex', u'pymbar Documentation',
u'John D. Chodera, Michael Shirts, Kyle A. Beauchamp', 'manual'),
u'John D. Chodera, Michael Shirts, Kyle A. Beauchamp, Levi N. Naden', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -284,7 +284,7 @@
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'pymbar', u'pymbar Documentation',
[u'John D. Chodera, Michael Shirts, Kyle A. Beauchamp'], 1)
[u'John D. Chodera, Michael Shirts, Kyle A. Beauchamp, Levi N. Naden'], 1)
]

# If true, show URL addresses after external links.
Expand All @@ -298,7 +298,7 @@
# dir menu entry, description, category)
texinfo_documents = [
('index', 'pymbar', u'pymbar Documentation',
u'John D. Chodera, Michael Shirts, Kyle A. Beauchamp', 'pymbar', 'One line description of project.',
u'John D. Chodera, Michael Shirts, Kyle A. Beauchamp, Levi N. Naden', 'pymbar', 'One line description of project.',
'Miscellaneous'),
]

Expand Down
43 changes: 28 additions & 15 deletions docs/timeseries.rst
Original file line number Diff line number Diff line change
@@ -1,46 +1,58 @@
.. currentmodule:: pymbar.timeseries

The :mod:`timeseries` module: :module:`pymbar.timeseries`:
=========================================================
The timeseries module :mod:`pymbar.timeseries`
==============================================

The :mod:`pymbar.timeseries` module contains tools for dealing with timeseries data.
The `MBAR <http://www.alchemistry.org/wiki/Multistate_Bennett_Acceptance_Ratio>`_ method is only applicable to uncorrelated samples from probability distributions, so we provide a number of tools that can be used to decorrelate simulation data.
The `MBAR <http://www.alchemistry.org/wiki/Multistate_Bennett_Acceptance_Ratio>`_ method is only applicable to
uncorrelated samples from probability distributions, so we provide a number of tools that can be used to decorrelate
simulation data.

Automatically identifying the equilibrated production region
------------------------------------------------------------

Most simulations start from initial conditions that are highly unrepresentative of equilibrated samples that occur late in the simulation.
Most simulations start from initial conditions that are highly unrepresentative of equilibrated samples that occur
late in the simulation.
We can improve our estimates by discarding these initial regions to "equilibration" (also known as "burn-in").
We recommend a simple scheme described in Ref. :cite:`chodera:jctc:2016:automatic-equilibration-detection`, which identifies the production region as the final contiguous region containing the *largest number of uncorrelated samples.
We recommend a simple scheme described in Ref. :cite:`chodera:jctc:2016:automatic-equilibration-detection`, which
identifies the production region as the final contiguous region containing the *largest* number of uncorrelated samples.
This scheme is implemented in the :func:`detectEquilibration` method:

.. python
.. code-block:: python
from pymbar import timeseries
[t0, g, Neff_max] = timeseries.detectEquilibration(A_t) # compute indices of uncorrelated timeseries
A_t_equil = A_t[t0:]
indices = timeseries.subsampleCorrelatedData(A_t_equil, g=g)
A_n = A_t_equil[indices]
In this example, the :func:`detectEquilibration` method is used on the correlated timeseries ``A_t`` to identify the sample index corresponding to the beginning of the production region, ``t_0``, the statistical inefficiency of the production region ``[t0:]``, ``g``, and the effective number of uncorrelated samples in the production region, ``Neff_max``.
The production (equilibrated) region of the timeseries is extracted as ``A_t_equil`` and then subsampled using the :func:`subsampleCorrelatedData` method with the provided statistical inefficiency ``g``.
In this example, the :func:`detectEquilibration` method is used on the correlated timeseries ``A_t`` to identify the
sample index corresponding to the beginning of the production region, ``t_0``, the statistical inefficiency of the
production region ``[t0:]``, ``g``, and the effective number of uncorrelated samples in the production
region, ``Neff_max``.
The production (equilibrated) region of the timeseries is extracted as ``A_t_equil`` and then subsampled using
the :func:`subsampleCorrelatedData` method with the provided statistical inefficiency ``g``.
Finally, the decorrelated samples are stored in ``A_n``.

Note that, by default, the statistical inefficiency is computed for every time origin in a call to :func:`detectEquilibration`, which can be slow.
If your dataset is more than a few hundred samples, you may want to evaluate only every ``nskip`` samples as potential time origins.
This may result in discarding slightly more data than strictly necessary, but may not have a significant impact if the timeseries is long.
Note that, by default, the statistical inefficiency is computed for every time origin in a call to
:func:`detectEquilibration`, which can be slow.
If your dataset is more than a few hundred samples, you may want to evaluate only every ``nskip`` samples as potential
time origins.
This may result in discarding slightly more data than strictly necessary, but may not have a significant impact if the
timeseries is long.

.. python
.. code-block:: python
nskip = 10 # only try every 10 samples for time origins
[t0, g, Neff_max] = timeseries.detectEquilibration(A_t, nskip=nskip)
Subsampling timeseries data
---------------------------

If there is no need to discard the initial transient to equilibration, the :func:`subsampleCorrelatedData` method can be used directly to identify an effectively uncorrelated subset of data.
If there is no need to discard the initial transient to equilibration, the :func:`subsampleCorrelatedData` method can be
used directly to identify an effectively uncorrelated subset of data.

.. python
.. code-block:: python
from pymbar import timeseries
indices = timeseries.subsampleCorrelatedData(A_t_equil)
Expand All @@ -51,6 +63,7 @@ Here, the statistical inefficiency ``g`` is computed automatically.
Other utility timeseries functions
----------------------------------

A number of other useful functions for computing autocorrelation functions from one or more timeseries sampled from the same process are also provided.
A number of other useful functions for computing autocorrelation functions from one or more timeseries sampled from the
same process are also provided.

.. automodule:: pymbar.timeseries

0 comments on commit ac648e6

Please sign in to comment.