-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #277 from California-Planet-Search/next-release
Version 1.3.0
- Loading branch information
Showing
27 changed files
with
632 additions
and
260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,23 @@ | ||
language: python | ||
sudo: False | ||
|
||
cache: | ||
directories: | ||
- $HOME/download | ||
- $HOME/miniconda2 | ||
- $HOME/miniconda3 | ||
- $HOME/.cache/pip | ||
- $HOME/.ccache | ||
services: | ||
- docker | ||
|
||
python: | ||
- "3.7" | ||
env: | ||
global: | ||
CACHE_IMAGE: bjfultn/radvel | ||
|
||
before_install: | ||
- export py="$(echo $TRAVIS_PYTHON_VERSION | head -c 1)" | ||
- wget http://repo.continuum.io/miniconda/Miniconda${py}-latest-Linux-x86_64.sh -O miniconda.sh | ||
- chmod +x miniconda.sh | ||
- bash miniconda.sh -b -u -p $HOME/miniconda | ||
- export PATH=/home/travis/miniconda/bin:$PATH | ||
- conda update --yes conda | ||
|
||
install: | ||
- if [ ${py} == "2" ]; then conda install --yes configparser==3.5.0b2; fi | ||
- conda install --yes pip numpy scipy matplotlib>=2.0.0 cython pandas nose nbformat nbconvert jupyter_client ipykernel tornado==4.5.3 | ||
- pip install coveralls pybind11 | ||
- pip install celerite | ||
- pip install . | ||
- python setup.py build_ext -i | ||
|
||
# configure a headless display using xvbf to test plot generation | ||
before_script: | ||
- "export DISPLAY=:99.0" | ||
- sleep 2 # give xvfb some time to start | ||
- docker pull $CACHE_IMAGE:latest || true | ||
- docker build --cache-from $CACHE_IMAGE:latest --tag radvel . | ||
|
||
script: | ||
- xvfb-run nosetests radvel --with-coverage --cover-package=radvel | ||
- docker run --env TRAVIS_JOB_ID=$TRAVIS_JOB_ID radvel | ||
|
||
after_success: | ||
- coveralls | ||
deploy: | ||
provider: pypi | ||
user: __token__ | ||
password: | ||
secure: oWyzGLMo0nAJJP3r4wa3HiSm6g5e9xxgsfG8/vtAIYmVUt3MkeXrihrBO+rEBWXpeFjFyN7WDJdQQnMRikDssEBfm63QIpLlZ9dlb/40h1rqVBzdYl5JBbsDGqkO1watb6cJR5hWtd7Mm0OiiZSq2OGdxH8ympc5RxXyNg3yRt2uP8K6s4kXUwHuOaVshx7N1TayEQr/IaBZjk6HoYY8amZUVxuyJO3hOuCm4R+P3qcRiW/dFXwGn8C5dq4ZCXZZJYCzrrubRO7zd6PvsMcxB2T4YnKjoe8lSAR1ZoAKmA4D+0ahDMmfDnCF5CEy8sMV5ePe5feXHJh8cKvbahWt7V5qSEbJYGLfl9i9uQEsnW3biyonDUvZFdFkwn7j4Z6GQ9MGrNsy9wQnSjoaNnzVgzli4z+CxgFRcuJ31Z8Jo8bRWesA5MVfc01LHxzLBit4JmzK+z7vxiNh4hxytQMVkaLEjS/C10RntkSSvYcEcXf+KpXF//0ixTN5/7fA+Ha8+nyNZdM6V+fhSZ3CawK4kj6rmjmmW3IpN3DO9sAJ+4efP6P27bFnvFhJ1m6OlHntpASjkbkPPg/Sb8CyzZU7Jck29P1vwh/+nzdUVArocDbPMW/RFH/eWsbv5MYxyWL7yNha2UTFVuvxMAfXiq58/VBhRkv0Kp2YiLnY6F1ktWI= | ||
on: | ||
tags: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
FROM conda/miniconda3 | ||
|
||
ENV TERM=xterm | ||
ENV TERMINFO=/etc/terminfo | ||
ENV COVERALLS_REPO_TOKEN=7ZpQ0LQWM2PNl5iu7ZndyFEisQnZow8oT | ||
|
||
|
||
RUN mkdir /code && \ | ||
mkdir /code/radvel && \ | ||
apt-get --yes update && \ | ||
apt-get install --yes gcc g++ git && \ | ||
conda config --add channels conda-forge && \ | ||
conda config --set channel_priority strict && \ | ||
conda update -n base -c defaults conda && \ | ||
pip install --no-cache-dir nose coveralls pybind11 && \ | ||
conda install -y -c conda-forge celerite | ||
|
||
WORKDIR /code/radvel | ||
ADD requirements.txt /code/radvel/requirements.txt | ||
|
||
RUN conda install -y --file requirements.txt && \ | ||
pip install --no-cache-dir -r requirements.txt | ||
|
||
ADD . /code/radvel | ||
|
||
|
||
RUN pip install --no-cache-dir . && \ | ||
python setup.py build_ext -i | ||
|
||
CMD nosetests radvel --with-coverage --cover-package=radvel && \ | ||
coveralls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
.. _autocorrintro: | ||
|
||
Introduction to Autocorrelation Times | ||
=============== | ||
|
||
.. _background: | ||
|
||
Background | ||
++++++++++++ | ||
|
||
As of v1.3.0 there are two additional new convergence criterion in addition to `maxGR` and `minTz` used to evaluate whether or not the MCMC chains are converged/well-mixed. | ||
`MinAfactor` and `maxArchange` both rely on the autocorrelation time. While a more in-depth | ||
explanation of autocorrelation and its relation to convergence can be found in the | ||
`documentation for emcee <https://emcee.readthedocs.io/en/stable/tutorials/autocorr/>`_, we will provide a brief | ||
description here. The original RadVel convergence checks are also still in place and are described in `Fulton et al. (2018) <https://ui.adsabs.harvard.edu/abs/2018PASP..130d4504F/abstract>`_. | ||
|
||
Autocorrelation time is the number of steps the walker needs to take for the chain to "forget" its initial position. | ||
Therefore, it can be used to reduce the error in your MCMC run and to tell if it is well-mixed. Using ``emcee3``, we can | ||
estimate this value for each parameter in an ensemble; if multiple ensembles are run, we combine their chains to receive | ||
the autocorrelation times. | ||
|
||
As the chain progresses, the estimated value of the autocorrelation time (τ) becomes more accurate. In the plot below, | ||
you can see that the the estimated autocorrelation time quickly rises and then begins to plateau as it nears the true | ||
value. | ||
|
||
.. image:: plots/plateau.png | ||
|
||
minAfactor | ||
+++++++++++ | ||
|
||
The autocorrelation time can be used to evaluate whether or not a chain is sufficiently long to be considered well-mixed. Therefore, if N steps have been | ||
taken, N/τ ≥ c, where c is what we call the autocorrelation factor. The minimum autocorrelation factor to consider the | ||
chains converged is represented by the criterion ``minAfactor``. The default value for ``minAfactor`` is 50, however we find | ||
that lower values may be sufficient, particularly for runs that take a long time; alternate values can be specified | ||
using the ``minAfactor`` argument when calling the MCMC. | ||
|
||
The autocorrelation factor is calculated for each parameter and the minimum of these values | ||
is returned in real time as the MCMC run progresses. | ||
Once the minimum autocorrelation factor is below ``minAfactor``, this criterion | ||
for convergence is met. Whether or not ``minAfactor`` has been satisfied can be seen in the autocorrelation plot below. Once the | ||
maximum autocorrelation time has passed the dashed line labeled 'Autocorrelation Factor Criterion,' the chain is likely converged. After five consecutive status checks appear past the dashed line, the MCMC will halt if all other criterion have also been met. | ||
|
||
.. image:: plots/minAfactor.png | ||
|
||
maxArchange | ||
+++++++++++++++++ | ||
|
||
While we want the autocorrelation factor to be sufficiently large, we want to make sure that it is being calculated with | ||
an accurate estimate of the autocorrelation time. We know our estimate for τ is accurate once it begins to plateau, | ||
allowing us to use the relative change in the autocorrelation time to infer whether or not the estimate is reliable. | ||
We calculate the relative change in autocorrelation time for each parameter between every convergence check. The largest | ||
of these values is also returned in real time and for the chain to be considered converged, it must fall below the | ||
criterion ``maxArchange``. | ||
|
||
The default value for ``maxArchange`` is .07, where we consider the autocorrelation time to begin leveling off. Rarely should | ||
you need to increase the ``maxArchange`` argument when running `radvel mcmc`, but for more conservative criterion, you may | ||
want to decrease it, particularly for long chains with large autocorrelation times (in such cases, the relative change | ||
may be small, but τ has not reached its plateau). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ Contents: | |
:maxdepth: 2 | ||
|
||
quickstartcli | ||
autocorrintro | ||
tutorials | ||
api | ||
|
||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.