Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View aflaxman's full-sized avatar

Abraham Flaxman aflaxman

View GitHub Profile
import pymc as pm
import numpy as np
# FIXME: Need to store duplicates too, when jumps are rejected. That means some mechanism
# for making sure the history is full-rank needs to be employed.
class HistoryCovarianceStepper(pm.StepMethod):
_state = ['n_points','history','tally','verbose']
@aflaxman
aflaxman / exp_sum_pymc.ipynb
Created November 6, 2012 18:58 — forked from Tillsten/exp_sum_pymc.py
Fit to an expontial sum in pymc
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aflaxman
aflaxman / .gitignore
Last active December 11, 2015 13:58 — forked from mbostock/.block
*~
import IPython.core.display
import matplotlib as mpl
def clean():
# set mpl defaults for nice display
mpl.rcParams['font.size'] = 12
mpl.rcParams['figure.figsize'] = (18, 6)
mpl.rcParams['lines.linewidth'] = 1
{
"metadata": {
"name": "2013_04_20b_hello_d3-vega-vincent"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@aflaxman
aflaxman / README.md
Created December 29, 2013 12:58 — forked from cingraham/README.md

Interactive graphic by Christopher Ingraham.

Source: American Community Survey 2012.

Last week this graphic of migration flows by Chris Walker made the rounds. Many commenters noted how beautiful the graphic is, and rightly so.

I always have a bit of a hard time parsing exactly what's going on within these Circos-style visualizations. Walker's graphic allows you to hover over a given state to highlight only those migrations, which helps quite a bit.

I thought there might be a better way to display these data, but I wasn't right. I stuck with a map, drawing circles for each state sized by net migration (comings minus goings) and colored according to whether the state gained or lost residents overall. To get at individual state flows, click a state - paths radiate inwards and outwards fr

{
"metadata": {
"name": "",
"signature": "sha256:53400d77ba7c32c0cc425b9c26b94a2bf7c3ed3c199a7b07c9c6526e9d844d8d"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [