# Fixing IPython plot windows after OS X upgrade

Note: These instructions are for the Conda Python environment manager. They should be adaptable to Virtualenv installations or others as well.

Often after installing OS X upgrades plots created in IPython open behind all windows and cannot be tabbed to. The following instructions should fix this:

1. Remove the current python ...

# Variational lower-bound for hidden Markov models

if you define the forward messages as the filtering distribution (like Beal), then the normalization constant from the update is $$p(y_t | y_{1:t-1})$$.

If you define the forward messages as the joint $$p(y_{1:t}, x_t)$$ like Emily does (and like Matt and we do), then the ...

# Convergent Series and lim inf

This little result came up when proving the convergence of a stochastic gradient algorithm and I want to write it down to remember it after discussions with Matt Johnson and Alex Tank.

Let $$a_1, a_2, \ldots$$ be a positive sequence of numbers. If \(\sum_{n=1}^\infty \frac{1}{n ...

# Debugging Python Extensions With Valgrind

In order to get line numbers when using Valgrind to debug Python extensions written in c/c++ you need to compile the extension with both the -O0 and the -g flags.

I have needed to implement some of my research code in C++ and I have been using the Eigen library for linear algebra. There are a lot of great things about Eigen, however, there are some hang-ups I have run into that do not seem to be documented anywhere. As ...

# Migrating the Blog to Github Pages

The account at my former institution was recently deleted. Unfortunately, I was hosting this blog there and so I was forced to migrate it somewhere else. I have always wanted to host the blog on Github Pages (where my site is hosted) and this seemed like good enough excuse to ...

# Calling Rmath from cython (sometimes R just does it better)

Recently I was writing some code that required the quantile function of the chi-squared distribution. There is a function in ccipy that implements this function, however, calling a python function from cython is slow. The scipy implementation calls a function in the cephes library. Unfortunately, scipy compiles the cephes library ...

# Types as function arguments in Julia

The multiple dispatch mechanism in Julia makes passing types as arguments to functions desirable. This technique is sometimes referred to as "types as tags" and a contrived example is presented below.

type A
end

type B
end

f(::Type{A}) = println("f with type A")
f(::Type{B}) = println("f ...

# Cleaning Cython Build Files

Whenever I use a setup.py script to build Cython code a variety of files are created including a .so file, one or more .c files and perhaps others. Until today I would delete these by hand as I did not have the patience to delve into what a setup ...

# Matplotlib 3D plots in IPython

### Summary:

Assume that

import matplotlib.pyplot as plt


has been executed.

When using mplot3d in IPython you have to manually draw the axes which can be done using the plt.draw function (or plt.plot([],[])).
For some reason the axes are not automatically drawn as with 2d plots.
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.4763249158859253, "perplexity": 2545.64533612955}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2017-47/segments/1510934806760.43/warc/CC-MAIN-20171123070158-20171123090158-00666.warc.gz"}