Old Maze Making Code

Playing around with that GIS optimization stuff was a chance for me to revisit some maze-making code I wrote a few years ago: http://healthyalgorithms.com/2011/01/07/piggies-and-mazes/ I wonder what age kids it will be good for.

Leave a comment

Filed under combinatorial optimization

Combinatorial Optimization for GIS

A real, applied problem in spatial epidemiology crossed my desk last week, and it turns out that it is a super-fun combinatorial optimization challenge, too.

Details here: http://gis.stackexchange.com/questions/126280/group-polygon-features-to-match-a-set-of-specifications

I don’t have time to play around with it a lot now, but I did try a little stochastic search, which makes me think that this will not be trivial to solve:

bad_clustering

Leave a comment

Filed under TCS

Bayesian Correlation in PyMC

Here is a StackOverflow question with a nice figure:

t0AeE

Is there a nice, simple reference for just what exactly these graphical model figures mean? I want more of them.

4 Comments

Filed under statistics

Statistics in Python: Calculating R^2

I wanted to include some old-fashioned statistics in a paper recently, and did some websearching on how to calculate R^2 in Python. It’s all very touchy, it seems. Here’s what I found:

http://stats.stackexchange.com/questions/36064/calculating-r-squared-coefficient-of-determination-with-centered-vs-un-center

http://stackoverflow.com/questions/893657/how-do-i-calculate-r-squared-using-python-and-numpy

http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.stats.linregress.html

http://forums.udacity.com/questions/100154896/why-is-r-squared-from-formula-different-than-scipy-functions-one

I eventually went with this:

%load_ext rmagic

x = np.array(1/df.J)
y = np.array(df.conc_rand)
%Rpush x y
%R print(summary(lm(y ~ x + 0)))

Leave a comment

Filed under statistics

Introducing Smudge

I had an inspiration to make something a couple weeks ago for #MakeSomethingDay (the productive alternative to #BuyNothingDay). It is a finger-painting app that neighborhood kids have been enjoying. http://bl.ocks.org/aflaxman/a31763011f9da46fc6d2

sascha's beautiful picture

1 Comment

Filed under dataviz

DB1B

I learned about a “big” data source for understanding air travel at the eScience incubator project talks last week, the DB1B database, aka the Airline Origin and Destination Survey. This is a 10% sample of all tickets for flights originating in the US, released quarterly since the 1993: http://www.transtats.bts.gov/DL_SelectFields.asp?Table_ID=289&DB_Short_Name=Origin%20and%20Destination%20Survey This must be good for something in global health.

Leave a comment

Filed under general

IHME Seminar: Social Networks for Policy Change by Jessica Shearer

Speaking of cool IHME seminars, last month we heard one on a social network analysis of the health policy actors involved in national-level policy change. So cool: http://www.healthdata.org/video/policy-development-integrated-community-case-management-iccm-national-and-global-levels-mixed

Leave a comment

Filed under global health