Skip to content

Commit

Permalink
Merge pull request #170 from migueldvb/corner
Browse files Browse the repository at this point in the history
Update the dependency on triangle module to corner
  • Loading branch information
dfm committed Oct 19, 2015
2 parents 50ac361 + 92ad3da commit 9a1128b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions docs/user/line.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ use the `scipy.optimize
m_ml, b_ml, lnf_ml = result["x"]
It's worth noting that the optimize module *minimizes* functions whereas we
would like the maximize the likelihood.
would like to maximize the likelihood.
This goal is equivalent to minimizing the *negative* likelihood (or in this
case, the negative *log* likelihood).
The maximum likelihood result is plotted as a solid black line—compared to
Expand Down Expand Up @@ -284,13 +284,13 @@ Results

Now that we have this list of samples, let's make one of the most useful plots
you can make with your MCMC results: *a corner plot*.
You'll need the `triangle.py module <https://github.com/dfm/triangle.py>`_ but
You'll need the `corner.py module <https://github.com/dfm/corner.py>`_ but
once you have it, generating a corner plot is as simple as:

.. code-block:: python
import triangle
fig = triangle.corner(samples, labels=["$m$", "$b$", "$\ln\,f$"],
import corner
fig = corner.corner(samples, labels=["$m$", "$b$", "$\ln\,f$"],
truths=[m_true, b_true, np.log(f_true)])
fig.savefig("triangle.png")
Expand Down
4 changes: 2 additions & 2 deletions examples/line.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from __future__ import print_function

import emcee
import triangle
import corner
import numpy as np
import scipy.optimize as op
import matplotlib.pyplot as pl
Expand Down Expand Up @@ -118,7 +118,7 @@ def lnprob(theta, x, y, yerr):
burnin = 50
samples = sampler.chain[:, burnin:, :].reshape((-1, ndim))

fig = triangle.corner(samples, labels=["$m$", "$b$", "$\ln\,f$"],
fig = corner.corner(samples, labels=["$m$", "$b$", "$\ln\,f$"],
truths=[m_true, b_true, np.log(f_true)])
fig.savefig("line-triangle.png")

Expand Down

0 comments on commit 9a1128b

Please sign in to comment.