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
a=1 |
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
\,{\buildrel d \over =}\, |
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
as.numeric(levels(f))[f] |
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
Y_i \sim \left\{ \begin{array}{l} | |
0, \text{with probability } (1-\psi) \\ | |
\text{Poisson}(\mu), \text{with probability } \psi | |
\end{array} \right. |
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
homebrew install gfortran | |
homebrew install python | |
homebrew install distribute | |
homebrew install pip | |
pip install ipython | |
pip install numpy | |
pip install scipy | |
pip install -f http://downloads.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.0/matplotlib-1.0.0.tar.gz matplotlib |
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
library(twitteR) | |
library(infochimps) | |
library(datamap) | |
infochimps('YOUR_API_KEY') | |
# Creates a new mapper, similar to an OO class | |
newMapper(type='twitchimps:influence', | |
# Init is called once during newMap(). Note that |
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
"""Routines related to plotting 2D distributions of parameters. | |
The core of this module is plot2Ddist, which plots a two-dimensional | |
distribution with 1D marginal histograms along each axis and optional | |
features like contours and lines indicating ranges and true values. | |
""" | |
import itertools | |
import math |
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
missing = -999 | |
filled_data = [(x, missing)[x is ''] for x in raw_data] |
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
import numpy as np | |
from scipy import linalg | |
def lse(A, b, B, d, cond=None): | |
""" | |
Equality-contrained least squares. | |
The following algorithm minimizes ||Ax - b|| subject to the | |
constrain Bx = d. | |
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 works just fine w/ multiprocess... | |
# now with more flushing | |
import sys | |
import time | |
sys.stdout.write("This is running") | |
sys.stdout.flush() | |
for i in range(5): | |
sys.stdout.write(".") |
OlderNewer