Wednesday, January 29, 2014

LaTeX tricks

Here is a collection of useful latex tricks I have been using in my papers.

How to add "sticky note" annotations to your manuscript

In the preamble of the document, add
\usepackage{todonotes}


For sticky notes:
\todo{your sticky note comment}



For notes placed in the text:
\todo[inline]{your sticky note comment}


For a missing figure box, such that you want to remind yourself to add a plot there later:
\missingfigure{figure description}


Read this for more options and the documentation of the todonotes package.


How to highlight or cross-out text

In the preamble of the document, add
\usepackage{color, soul}
\setstcolor{red}


For highlighted text:
\hl{your highlighted text}


For crossing-out text:


Check this out for more options.



For commenting out larger chunks of text

In the preamble of the document, add
\usepackage{verbatim}


Then put the text you want to comment out inside the environment:
\begin{comment}
everything your want to not show up in the document
\end{comment}

Can be way more powerful and faster than appending the % character to the beginning of each line.


Thursday, January 16, 2014

Video tutorial: Bayesian data analysis with PyMC 3

I highly recommend the tutorial by Thomas Wiecki on using PyMC 3 to perform Bayesian data analysis. Some of the cool things he demonstrates in this ~50 min video:

  • summary of Bayesian analysis and Bayesian theorem
  • application for parameter estimation for a few introductory examples: coin-flipping experiment, simple linear regression
  • new features of PyMC 3 with respect to v2
  • how to construct a model in PyMC 3 and a few notes on samplers
  • more advanced example: application to time series of correlated stocks, then linear regression of correlated stocks with a time-dependent slope (!!)