<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>Sean J. Taylor 
is probably experimenting on you.</description><title>Decomposition</title><generator>Tumblr (3.0; @seanjtaylor)</generator><link>http://seanjtaylor.com/</link><item><title>Talk on Ranking NFL Teams</title><description>&lt;p&gt;I gave &lt;a href="http://www.meetup.com/nyhackr/events/99758422/"&gt;a talk last month&lt;/a&gt; at the &lt;a href="http://www.meetup.com/nyhackr/" title="New York Open Statistical Programming Meetup - New York, NY"&gt;New York Open Statistical Programming Meetup&lt;/a&gt; on ranking systems, specifically applied to the NFL. You can find &lt;a href="http://seanjtaylor.github.com/NFLRanking/web/slides/"&gt;slides&lt;/a&gt;, &lt;a href="https://github.com/seanjtaylor/NFLRanking"&gt;code&lt;/a&gt;, and an &lt;a href="http://nbviewer.ipython.org/urls/raw.github.com/seanjtaylor/NFLRanking/master/NFL%2520Rankings.ipynb"&gt;IPython notebook&lt;/a&gt; which contains most of the information. I encourage you to look at the slides, which I spent a lot of time on.  They contain two embedded &lt;a href="http://seanjtaylor.github.com/NFLRanking/web/slides/#/6/2"&gt;interactive&lt;/a&gt; &lt;a href="http://seanjtaylor.github.com/NFLRanking/web/slides/#/13/1"&gt;visualizations&lt;/a&gt;.  I did get my Super Bowl prediction wrong, though.&lt;/p&gt;
&lt;p&gt;T&lt;span&gt;here were about 200 attendees, but unfortunately&lt;/span&gt;&lt;span&gt; there is no video of the talk. &lt;/span&gt;&lt;span&gt;Thanks to everyone who came; it was incredibly fun for me.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The talk was mostly a review/comparison of different methods:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Pythagorean wins&lt;/li&gt;
&lt;li&gt;Eigenvector methods&lt;/li&gt;
&lt;li&gt;the Bradley-Terry-Luce model&lt;/li&gt;
&lt;li&gt;optimal rankings&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;The last one warrants more explanation.  I had &lt;a href="http://seanjtaylor.com/post/36149816687/optimal-descriptive-nfl-rankings"&gt;previously reviewed&lt;/a&gt; the optimal descriptive ranking problem and my solution.  It&amp;#8217;s a fascinating application of graph theory to a problem that most people wouldn&amp;#8217;t consider to be graph-theoretic.  Once the ranking problem is posed as a topological sort of a graph which contains cycles, it&amp;#8217;s easy to describe an exact (if non-unique) solution as well as find an algorithm to approximate it.  The results are quite stunning: a 10+% increase in the number of correctly described games from the other models.&lt;/p&gt;</description><link>http://seanjtaylor.com/post/43765697820</link><guid>http://seanjtaylor.com/post/43765697820</guid><pubDate>Fri, 22 Feb 2013 20:34:02 -0500</pubDate></item><item><title>NFL Fans on Facebook</title><description>&lt;a href="https://www.facebook.com/notes/facebook-data-science/nfl-fans-on-facebook/10151298370823859"&gt;NFL Fans on Facebook&lt;/a&gt;: &lt;p&gt;I made a promise to myself when I interned at Facebook that I would write at least one blog post on the NFL.  Today I got to publish it!  Technically this was all quite trivial, mostly just aggregating users by teams and geography, then producing the maps using D3 (I had to rasterize them to post them on Facebook).&lt;/p&gt;
&lt;p&gt;The NFL friendships thing involved a join on the social graph with the Like graph.  If I had had more time, I would have looked for rivalries.  My plan was to look for friendships that were unlikely holding relative geography fixed but changing the two teams.  The idea was to look for some pairs of teams that despite having pairs of fans in close proximity are unlikely to have fan friendships.&lt;/p&gt;
&lt;p&gt;The finding that winning is correlated with Likes is also interesting.  To an economist, this would seem to be an excellent instrumental variable.  (This is &lt;a href="http://www.nber.org/papers/w15497"&gt;not a new idea&lt;/a&gt;).  Conditional on the spread of the game, wins and losses are basically coin flips, and yet they seem to be correlated with big increases in team fan bases. This strategy could potentially be used to identify peer effects if one were willing to make a bundle of assumptions about dynamics.&lt;/p&gt;</description><link>http://seanjtaylor.com/post/41740696607</link><guid>http://seanjtaylor.com/post/41740696607</guid><pubDate>Mon, 28 Jan 2013 19:18:00 -0500</pubDate></item><item><title>Real scientists make their own data</title><description>&lt;p&gt;Around budding social- and data scientists, a question you often hear is &amp;#8220;where can I get data?&amp;#8221;  It happens so often that people like Hilary Mason, who I&amp;#8217;m sure gets this question all the time, have posted &lt;a href="http://www.hilarymason.com/projects/need-data-start-here/"&gt;pages with resources&lt;/a&gt;. Getting new data can be just what you need to practice a technique you are learning or complete a project that you can publish or add to your portfolio.&lt;/p&gt;
&lt;p&gt;Here I argue that if you want to make a bigger impact as a scientist, you should &lt;strong&gt;make&lt;/strong&gt; your own data instead of downloading it. Here are my points:&lt;/p&gt;
&lt;p&gt;&lt;!-- more --&gt;&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Historically science has been about observing (and sometimes manipulating) phenomena. Some of the most important contributions across all fields of science have occurred through actual hands-on data collection.&lt;/li&gt;
&lt;li&gt;Making your own data means you are creating new facts about the world which gives you privileged access to scientific findings. Novel data is a source of competitive advantage that is sustainable, unlike being clever about your analysis.&lt;/li&gt;
&lt;li&gt;When you invest in making your own data, you are forced to consider your research question long before diving into analyses. Having data that were costly to gather or create conveys that you are a thoughtful, careful researcher who knows a lot about her domain. And it probably means that you are addressing an important question.&lt;/li&gt;
&lt;li&gt;If you are the creator of your data set, then you are likely to have a great understanding the data generating process. Blindly downloading someone&amp;#8217;s CSV file means you are much more likely to make assumptions which do not hold in the data.&lt;/li&gt;
&lt;li&gt;Making your own data means you can run randomized experiments, which enable you to &lt;a href="http://en.wikipedia.org/wiki/Random_assignment"&gt;make causal inferences&lt;/a&gt;. This is a big deal if you want to make any claims about policy decisions.&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;Think about a famous scientist who has inspired you. It&amp;#8217;s likely he or she invested heavily in data collection. From &lt;a href="http://en.wikipedia.org/wiki/Aristotle#Empirical_research_program"&gt;Aristotle&lt;/a&gt; to famous natural philosophers&amp;#8212;such as &lt;a href="http://en.wikipedia.org/wiki/Galileo"&gt;Galileo&lt;/a&gt;&amp;#8212;practicing what evolved into modern science, there is rich tradition of making careful observations of interesting phenomena. Without modern methodology and theory, these proto-scientists were making important discoveries through careful record-keeping.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Gregor_Johann_Mendel"&gt;Gregor Mendel&lt;/a&gt; spent years breeding bees and pea plants in order discover the laws of modern genetics. &lt;a href="http://en.wikipedia.org/wiki/Ronald_Fisher"&gt;Ronald Fisher&lt;/a&gt;, who we tend to regard as a statistician due to his methodological contributions, was actually coordinating large-scale experiments with crops at the Rothamsted Experimental Station.  They had to use elbow grease and waited a long time to make important new discoveries.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Stanley_Milgram"&gt;Stanley Milgram&lt;/a&gt; is perhaps the best example of making your own data. The creativity in his work was apparent by how he approached difficult but  important questions. He didn&amp;#8217;t throw his hands up and resort to casual theorizing, he invented &lt;a href="http://en.wikipedia.org/wiki/Small-world_experiment"&gt;novel empirical strategies&lt;/a&gt; like sending chain letters to find answers.&lt;/p&gt;
&lt;p&gt;This is my thesis:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Your best chance to make a serious contribution as a business or academic researcher is to find, make and combine novel data.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Almost everybody in your field will be as well-trained as you are.  They will be able to run a Google search for data sets just as you can, and they will be able to apply methods like regression, clustering, visualization, etc on the data they find. If you want to compete, I suggest you allocate a substantial portion of your effort toward both 1) asking excellent questions and 2) constructing your own data which are suitable to directly answer them.&lt;/p&gt;
&lt;p&gt;Many social/digital scientists are reluctant to invest in making data because it&amp;#8217;s much more costly and risky than analyzing data you already have available. Sure it&amp;#8217;s a gamble, but the payoffs can be substantial, both for science and for your reputation. As a thought experiment, I urge you to consider the last time you were really wowed by a finding that wasn&amp;#8217;t produced using new data.&lt;/p&gt;
&lt;p&gt;But how can you make your own data?  Here are my suggestions:&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;If you already work as a data scientist for a company with a product or service, &lt;strong&gt;add your own instrumentation&lt;/strong&gt; instead of relying on logs. Get permission to run &lt;a href="http://arxiv.org/pdf/1206.4327.pdf"&gt;randomized experiments which can tackle tough questions&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;If you don&amp;#8217;t work for a company, &lt;strong&gt;ask to partner with or intern for one&lt;/strong&gt;. If you are answering a question they find interesting, and you are willing to help plan the data collection and analysis, you might just get their attention. Help out at &lt;a href="http://datakind.org/"&gt;DataKind&lt;/a&gt; and you&amp;#8217;re almost guaranteed to get new data that no one has ever seen before.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Experiment on or survey your friends&lt;/strong&gt;. With social networks and kind friends (and maybe some promises of free drinks), you can often get a large enough convenience sample to test a hypothesis.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Buy some new friends&lt;/strong&gt;. Many &lt;a href="http://www.pnas.org/content/109/36/14363.short"&gt;excellent behavioral studies&lt;/a&gt; have been conducted on &lt;a href="https://www.mturk.com/mturk/welcome"&gt;Mechanical Turk&lt;/a&gt;, including some in progress by &lt;a href="http://drewconway.com/Drew_Conway/About.html"&gt;famous data scientists&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Build your own website or application&lt;/strong&gt;. This is the costliest route, but allows you the most control. I spent two years building &lt;a href="http://creds.me"&gt;Creds&lt;/a&gt; so I could study how beliefs about uncertainties are correlated in social networks. Some researchers at Boston University built a news reader application to &lt;a href="http://www.krannert.purdue.edu/faculty/kkarthik/wise12/papers/wise12_submission_10.pdf"&gt;study how humans allocate attention to news articles&lt;/a&gt;. This is a serious gamble that could pay off in a big way.&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;I&amp;#8217;m sick of seeing the same old data sets recycled with a slightly new analysis done. Use old data to practice techniques, but if you want to get serious about being a scientist, make your own data.&lt;/p&gt;</description><link>http://seanjtaylor.com/post/41463778912</link><guid>http://seanjtaylor.com/post/41463778912</guid><pubDate>Fri, 25 Jan 2013 16:13:00 -0500</pubDate></item><item><title>Creds Blog: The Simon-Ehrlich Wager and Another Role for Markets</title><description>&lt;a href="http://blog.creds.me/post/40344263944/the-simon-ehrlich-wager-and-another-role-for-markets"&gt;Creds Blog: The Simon-Ehrlich Wager and Another Role for Markets&lt;/a&gt;: &lt;p&gt;&lt;a href="http://creds.me"&gt;Creds&lt;/a&gt; is a side-project I’ve been working on for awhile now. I encourage you to 1) check it out and 2) read this post to see my inspiration.&lt;/p&gt;
&lt;p&gt;&lt;a class="tumblr_blog" href="http://blog.creds.me/post/40344263944/the-simon-ehrlich-wager-and-another-role-for-markets"&gt;credsblog&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In 1980, an economist named Julian Simon and a biologist named Paul Ehrlich had a disagreement about the future scarcity of natural resources on Earth. Being gentlemen, they &lt;a href="http://en.wikipedia.org/wiki/Simon%E2%80%93Ehrlich_wager"&gt;decided to stake some token money&lt;/a&gt;-as well as their reputations-on what they believed.  &lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://seanjtaylor.com/post/40547750250</link><guid>http://seanjtaylor.com/post/40547750250</guid><pubDate>Mon, 14 Jan 2013 17:25:06 -0500</pubDate></item><item><title>The Statistics Software Signal</title><description>&lt;p&gt;Last night on Twitter, I went on a bit of a rant about statistics packages (namely Stata and SPSS).  My point was not that these software packages are bad per se, but that I have found them to be correlated with bad quality science.  Here is my theory why.&lt;/p&gt;
&lt;p&gt;&lt;!-- more --&gt;&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;&lt;strong&gt;When you don&amp;#8217;t have to code your own estimators, you probably won&amp;#8217;t understand what you&amp;#8217;re doing.&lt;/strong&gt; I&amp;#8217;m not saying that you definitely won&amp;#8217;t, but push-button analyses make it easy to compute numbers that you are not equipped to interpret.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;When it&amp;#8217;s extremely low cost to perform inference, you are likely to perform a lot of inferences. &lt;/strong&gt;When your first regression gives a non-result, you run a second one, and a third one, etc. This leads untrained researchers to run into &lt;a href="http://en.wikipedia.org/wiki/Multiple_comparisons"&gt;multiple comparisons problems&lt;/a&gt; and increases the risk of Type I errors.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;When operating software doesn&amp;#8217;t require a lot of training, users of that software are likely to be poorly trained. &lt;/strong&gt;This is an &lt;a href="http://en.wikipedia.org/wiki/Adverse_selection"&gt;adverse selection issue&lt;/a&gt;. Researchers who care about statistics enough should have gravitated toward R at some point.  I also trust results produced using R, not because it is better software, but because it is difficult to learn.  The software is not causing you to be a better scientist, but better scientists will be using it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;When you use proprietary software, you are sending the message that you don&amp;#8217;t care about whether people can replicate your analyses or verify that the code was correct. &lt;/strong&gt;Most commercial software is closed source and expensive.  We can never know if the statisticians at Stata have a bug in their code unless we trust them to tell us.  Also consider researchers from schools or companies which can&amp;#8217;t afford expensive commercial software.  Should they not be able to reproduce your results?&lt;/li&gt;
&lt;/ol&gt;&lt;div&gt;I do think these packages are valuable can be used for good. I have used Stata and it has saved me plenty of time.  My main point is that there are a number of mechanisms through which bad science can be correlated with using push-button statistics software, not that one is a direct consequence of the other.&lt;/div&gt;
&lt;hr&gt;&lt;p&gt;What your statistical software says about you (to me):&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;R&lt;/strong&gt;: You are willing to invest in learning something difficult.  You do not care about aesthetics, only availability of packages and getting results quickly. &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Python or JVM languages&lt;/strong&gt;: You are a hacker who may have already been a programmer before you delved into statistics. You are probably willing to run alpha or beta-quality algorithms because the statistical package ecosystem is still evolving. You care about integrating your statistics code into a production codebase.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Julia&lt;/strong&gt;: You are &lt;a href="http://johnmyleswhite.com/"&gt;John Myles White&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Stata&lt;/strong&gt;: You are an economist who doesn&amp;#8217;t care to code your own estimators, probably because your comparative advantage lies elsewhere.  Possibly you are doing sophisticated work with panel data where Stata is the only game in town.  You don&amp;#8217;t care that you can&amp;#8217;t do proper programming because you&amp;#8217;re not a programmer.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SPSS&lt;/strong&gt;: You love using your mouse and discovering options using menus. You are nervous about writing code and probably manage your data in Microsoft Excel.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Matlab&lt;/strong&gt;: You definitely know what you&amp;#8217;re doing and you care about performance. You know Matlab is expensive but you aren&amp;#8217;t the one paying for it. You live in a bubble where everyone you know uses Matlab.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mathematica&lt;/strong&gt;: You are an aesthete who &lt;a href="http://blog.wolfram.com/2012/11/28/mathematica-9-is-released-today/"&gt;believes everything Stephen Wolfram says&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SAS&lt;/strong&gt;: You are an analyst for a large pharmaceutical company, and SAS is all you have ever known. You have a large library of custom SAS macros, so that (clearly) makes you a programmer. That anyone would want to hand-code statistical methods leaves you utterly baffled. If SAS does not ship with a particular statistical method, then it probably isn&amp;#8217;t important. (h/t &lt;a href="https://twitter.com/fonnesbeck"&gt;Chris Fonnesbeck&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;</description><link>http://seanjtaylor.com/post/39573264781</link><guid>http://seanjtaylor.com/post/39573264781</guid><pubDate>Thu, 03 Jan 2013 11:52:00 -0500</pubDate></item><item><title>Trouble in the Sandia Mountains</title><description>&lt;p&gt;Last night I made a series of decisions that seriously jeopardized my life.&lt;/p&gt;
&lt;p&gt;The Sandia mountains rise up to the East of Albuquerque and provide views of a beautiful Southwest sunset.  You can take a cable car up to a lodge at the crest of the mountains.  When we arrived at the departure point, I decided I would go for a quick trail run when we got to the top.  Having been trapped in the car all day on our way from Flagstaff, I was excited to move.  I had been running mostly in San Francisco the last few months and missed the rugged terrain I frequented while I was living in Palo Alto over the summer.&lt;/p&gt;
&lt;p&gt;&lt;!-- more --&gt;&lt;img alt="image" src="http://media.tumblr.com/tumblr_memab6hUQw1r1x9ql.jpg"/&gt;&lt;/p&gt;
&lt;p&gt;But more than that, I had hiked on South Crest Trail before, six years ago when visiting Albuquerque with a then-girlfriend.  I thought the trail was amazing and wanted to push further, but she was pragmatic and made me turn around earlier than I wanted. From the cable car you can track the crest of the trail and see dozens of spectacular Western-facing viewpoints along the way.  I thought this was a great opportunity to see some of the views that I had missed a few years ago.&lt;/p&gt;
&lt;p&gt;We arrived with only 75 minutes of sunlight left, so I dressed quickly and left my phone in the car. It was 65 degrees, sunny, and calm at the base of the mountain, but in the waiting room for the cable car, there is a weather station showing that going up to 10,000 feet of elevation would drop the temperature to 36 degrees and increase the wind to 28mph.  I looked down at my shorts and running hoodie and decided it would be ok but that I was pushing it.&lt;/p&gt;
&lt;p&gt;When we got the top I quaffed some water at the fountain in the tram station and took off to the South.  It was immediately familiar so I stopped to enjoy a few views very briefly but pushed on to see what was further.  The trail was rough: lots of rocks and quick elevation changes, surrounded by dense pine trees.  I figured I would run about 25 minutes out and then turn around in time to use dusk-light to find my way back.  The trail didn&amp;#8217;t seem complicated enough to get lost with only a couple of obvious-seeming turns.&lt;/p&gt;
&lt;p&gt;Sadly, the trail meandered to the left along the Eastern side of the ridge.  This meant two things: no views of the sun setting to the West and it was getting darker faster than I thought.  I figured if ran a bit further eventually it would come back up the crest and I could catch the beginning of the sunset.  I picked up my pace.&lt;/p&gt;
&lt;p&gt;This actually worked-as the trail winded to the right almost 180 degrees and ended up giving me some of the views I was craving.  Perhaps it was altitude-induced optimism, but I thought that maybe it would provide me an alternative route home that wouldn&amp;#8217;t require retracing all my steps.  I pushed on for longer than I should have before realizing I was on a completely separate ridge in the mountain.  I would need to run even further to get home.&lt;/p&gt;
&lt;p&gt;I ran faster as I realized I was running out of daylight. The Eastern side of the mountain was already quite dark. As I ran out of light, I had to slow my pace to avoid turning my ankle on a rock. After 20 minutes of hurrying to get back I realized I was actually descending the mountain on the Eastern side.  I had made a wrong turn at some point and it wasn&amp;#8217;t obvious to me where.  The difference between the trail and the woods was now barely visible.&lt;/p&gt;
&lt;p&gt;I began yelling &amp;#8220;Hello&amp;#8221; and &amp;#8220;Help&amp;#8221; at regular intervals, hoping that I could find another hiker. I never heard a response. I turned around and headed back, straining my eyes to look for landmarks.  I knew that keeping calm was the most important thing but it was a struggle to do so.  It was only getting colder and darker.  The one upshot was that I knew I couldn&amp;#8217;t be more than a couple miles from the cable car station and that my dad and sister would be wondering where I was.  At worst I would need to be found by rangers with flashlights.  The questions were whether it would get to that point and how long that would take.&lt;/p&gt;
&lt;p&gt;Doubling back, I felt more lost than before because I was headed in the wrong direction.  Perhaps the scariest part was finding a turn in the right direction, following it for awhile and realizing I was looping back in the wrong direction. Then I experienced the old &amp;#8220;getting lost&amp;#8221; trope of seeing the same landmark twice, in this case a pair of white logs crossed in an X which were visible in the moonlight.&lt;/p&gt;
&lt;p&gt;At this point it was so dark I was barely staying on the trail. I had to reach down and feel the ground to make sure it was soft and loose to make sure I was walking where I was supposed to. Despite this strategy, I made countless mistakes and tore up my legs walking through brush. Losing the trail like this was the scariest thing I experienced. At some points I would get on my hands and knees and crawl around until I found soft dirt to walk on.&lt;/p&gt;
&lt;p&gt;I backtracked more and found a signpost I knew was on my original route. This was where I had made the wrong turn. Following the trail out from here was harder than I expected, but from here it was only a matter of time until I found my out.  I knew this and started deliriously belting out &amp;#8220;99 bottles of beer on the wall&amp;#8221; as I marched toward the station. This last bit was firmly on the ridge and dimly lit by Albuquerque city lights.  I knew I would be ok.&lt;/p&gt;
&lt;p&gt;I arrived at the cable car station at around 7:15pm, two hours after I expected to be getting home. I was deliriously happy until I saw how upset my dad and sister were. They were on the phone with the state police and desperately trying to get them to send out a search party.  I had gotten there just in time to prevent that.&lt;/p&gt;
&lt;p&gt;The lessons in this story can only be described as common sense. I went running too late, pushed too hard, and underestimated how dark it would get. It was pure trail-runner arrogance that got me into this situation.  I hadn&amp;#8217;t brought a flashlight or a phone, either of which would have made this situation far less hopeless.&lt;/p&gt;
&lt;p&gt;Despite the stupidity I demonstrated, I feel like it was a valuable experience.  Sometimes you need to make stupid mistakes and suffer the consequences to learn lessons. Escaping the danger I faced in the woods, in the dark, has made me more appreciative than ever at how wonderful my life is.&lt;/p&gt;</description><link>http://seanjtaylor.com/post/37336492003</link><guid>http://seanjtaylor.com/post/37336492003</guid><pubDate>Thu, 06 Dec 2012 11:12:00 -0500</pubDate><category>personal</category></item><item><title>Optimal Descriptive NFL Rankings</title><description>&lt;p&gt;Most NFL fans, like myself, obsess over who&amp;#8217;s going to win games or which players to start in our fantasy football leagues. One of the fundamental tools we use to look at this are rankings. Rankings are the simplest possible model that can represent a &lt;a class="reference external" href="http://en.wikipedia.org/wiki/Total_order"&gt;total order&lt;/a&gt;, which you can think of as a function that allows you to compare all possible pairs in your set.&lt;/p&gt;
&lt;div class="document"&gt;
&lt;div class="section" id="describing-the-nfl-season"&gt;
&lt;h1&gt;Describing the NFL season&lt;/h1&gt;
&lt;p&gt;In the NFL regular season, each of the 32 teams plays 16 games. The result is 256 binary outcomes, which if we assume are the same as coin flips (independent trials of a fair coin), then the entirety of the season contains at most 256 bits of &lt;a class="reference external" href="http://en.wikipedia.org/wiki/Entropy_(information_theory)"&gt;information&lt;/a&gt;. One way to think about this is that if you could send yourself a string of 256&amp;#160;1s or 0s from January back in time to Septmeber, with a simplistic coding scheme, your past self could correctly predict all 256 games.&lt;/p&gt;
&lt;p&gt;I began to &lt;a class="reference external" href="https://twitter.com/seanjtaylor/status/256560211370848256"&gt;think&lt;/a&gt;: we all love rankings, but how well can you describe the season with a ranking of teams? There are 32! possible rankings, so a ranking of all 32 teams contains log2(32!) bits of information, or about 118 bits. This is the smallest amount of information you could use to describe what happens in all possible pairings of teams. How accurate is it to describe 256 bits with 118 bits? How many games would you get wrong?&lt;/p&gt;
&lt;p&gt;This is also a good way to look at how random outcomes are. If rankings can&amp;#8217;t describe the season well, then it&amp;#8217;s hard to have a good intuition about which teams are the best in the league.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="ranking-algorithms"&gt;
&lt;h1&gt;Ranking algorithms&lt;/h1&gt;
&lt;p&gt;Given my training in statistics and love of the NFL, I have &lt;a class="reference external" href="http://dehype.posterous.com/2011-regular-season-power-rankings"&gt;tried ranking teams before&lt;/a&gt;. The model I used then is a variant of the &lt;a class="reference external" href="http://www.mathpsyc.uni-bonn.de/doc/Maris/node25.html"&gt;BTL model&lt;/a&gt;. These models essentially posit that teams can be assigned a real number that represents their strength (they exist in a latent &amp;#8220;quality&amp;#8221; space), and that the probability of team A beating team B is proportional to the differences in their strengths. Essentially this is a logistic regression with dummy variables for teams.&lt;/p&gt;
&lt;p&gt;As I looked into the &lt;a class="reference external" href="http://www.math.utah.edu/~keener/lectures/rankings.pdf"&gt;mathematics of ranking&lt;/a&gt;, I found that many smart people have thought long and hard about this problem. The abstract problem is how to take a series of &lt;a class="reference external" href="http://en.wikipedia.org/wiki/Pairwise_comparison"&gt;pairwise comparisons&lt;/a&gt; and generate a total order relation.&lt;/p&gt;
&lt;p&gt;The tricky bit is that these problems have a recursive structure: first you rank teams naively, then you re-rank adjusting for strength of schedule from your naive ranking, then you re-rank using the new strengths, and so forth. It&amp;#8217;s no surprise then that most sophisticated ranking procedures use something like the &lt;a class="reference external" href="http://en.wikipedia.org/wiki/Power_method"&gt;power method&lt;/a&gt; to compute eigenvectors of a square matrix that encodes the pairwise comparisons.&lt;/p&gt;
&lt;p&gt;The BTL model is probabilistic, while the eigenvector model is derived using linear algebra. They are computed differently but there is a deep relationship between the two in that they optimize very similar objective functions.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="optimal-ranking-with-graphs"&gt;
&lt;h1&gt;Optimal ranking with graphs&lt;/h1&gt;
&lt;p&gt;The pairwise comparison matrix (the element at row i, column j is 1 if i beat j) is also a &lt;a class="reference external" href="http://en.wikipedia.org/wiki/Adjacency_matrix"&gt;representation&lt;/a&gt; for a directed graph. Using this representation, the ranking problem can then be posed slightly differently.&lt;/p&gt;
&lt;p&gt;In the BTL model and the eigenvector model, we wanted to project each team onto the real line. If we think of our pairwise comparisons as constituting a directed graph, then the ranking is actually a &lt;a class="reference external" href="http://en.wikipedia.org/wiki/Path_(graph_theory)"&gt;path&lt;/a&gt; through the graph. At first I thought this path might be related to the &lt;a class="reference external" href="http://en.wikipedia.org/wiki/Travelling_salesman_problem"&gt;TSP&lt;/a&gt; with appropriate edge-weights, but this was a bit off.&lt;/p&gt;
&lt;p&gt;The algorithm to find this path is called a &lt;a class="reference external" href="http://en.wikipedia.org/wiki/Topological_sorting"&gt;topological sort&lt;/a&gt;, the directed graph equivalent of a minimum spanning tree for an undirected graph. The problem is, you can&amp;#8217;t perform a topological sort when there are cycles in the graph. Cycles are a generalization of transitivity violations: situation where A beat B, B beat C, but C beat A. We can&amp;#8217;t sort the graph if these exist. If they don&amp;#8217;t, the sort can take place in linear time.&lt;/p&gt;
&lt;p&gt;The set of edges (games) which introduce cycles into the graph is called the &lt;a class="reference external" href="http://en.wikipedia.org/wiki/Feedback_arc_set"&gt;feedback arc set&lt;/a&gt; (FAS). You can think of this as the set of cases the ranking model is too simplistic to explain. It seems a bit backwards, but if we can get rid of all the upsets in advance, then we can rank the teams easily and quickly. Finding the minimum FAS is an NP-hard problem (of course!), but for a 256 edge graph, it&amp;#8217;s not a problem to compute it with &lt;a class="reference external" href="http://igraph.sourceforge.net/"&gt;igraph&lt;/a&gt; among others packages. The minimal FAS set is not guaranteed to be unique (for a trival example, the minimal FAS set for a 3-cycle can be any of the three edges &lt;a class="footnote-reference" href="#id2" id="id1"&gt;[1]&lt;/a&gt;), so unfortuntately the ranking may not be unique.&lt;/p&gt;
&lt;p&gt;After removing the FAS, the topological sort produces the optimal ranking in the following sense: no other ranking will make fewer mistakes when applied to the 256 games. This is essentially minimizing &lt;a class="reference external" href="http://en.wikipedia.org/wiki/Loss_function"&gt;0-1 loss&lt;/a&gt; of the model, which is exactly our objective function if we want rankings that make the fewest mistakes. This ranking may not be unique, but you cannot describe the season better with any ranking model.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="results"&gt;
&lt;h1&gt;Results&lt;/h1&gt;
&lt;p&gt;I implemented a few ranking systems in Python. You can checkout the &lt;a class="reference external" href="https://github.com/seanjtaylor/NFLRanking"&gt;code on github&lt;/a&gt;. What I find amazing is how poorly BTL and eigenvector methods compare, at least descriptively, to optimal ranking. These rankings only are only about 70-75% accurate, while optimal ranking almost always breaks 80%. This is about 10-20 games which would be considered upsets under BTL and eigenvector methods that would not be considered upsets under the optimal ranking.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="visualizing"&gt;
&lt;h1&gt;Visualizing&lt;/h1&gt;
&lt;p&gt;I put together a visualization of the win-matrix using &lt;a class="reference external" href="http://d3js.org/"&gt;d3.js&lt;/a&gt;. Squares are colored if the row team beat the column team. Our &amp;#8220;loss&amp;#8221; comes from wins that are inconsistent with our ranking model&amp;#8212;any square beneath the diagonal. You can also look at a &lt;a class="reference" href="/nfl-win-matrix"&gt;bigger&lt;/a&gt; and interactive version of the visualization.&lt;/p&gt;
&lt;div id="matrix"&gt;&lt;/div&gt;
&lt;a class="graph-nav" id="name"&gt;Name&lt;/a&gt; &lt;a class="graph-nav" id="count"&gt;Wins&lt;/a&gt; &lt;a class="graph-nav" id="brank"&gt;BTL&lt;/a&gt; &lt;a class="graph-nav" id="orank"&gt;Optimal Rank&lt;/a&gt;
&lt;div&gt;Loss: &lt;span id="loss"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script src="http://d3js.org/d3.v2.min.js?2.8.1" type="text/javascript"&gt;&lt;/script&gt;&lt;script src="http://static.tumblr.com/ewblwo4/tiEmdsw4v/graphics.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script src="http://static.tumblr.com/ewblwo4/w2Pmdsw6x/run.graphics.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/div&gt;
&lt;div class="section" id="a-challenge-minimum-description-length"&gt;
&lt;h1&gt;A Challenge: minimum description length&lt;/h1&gt;
&lt;p&gt;I have shown that, at least for the task of &lt;em&gt;description&lt;/em&gt;, a graph-based algorithm which minimizes the correct loss function is superior to probabilistic models which don&amp;#8217;t actually minimize the right thing. But the ranking is still not a perfect representation of the NFL season, getting about 20% of the games wrong on average. My question to you is: describe a 100% accurate encoding of the NFL season that uses the fewest possible bits. I have thought hard about this and still don&amp;#8217;t have a satisfying answer.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;</description><link>http://seanjtaylor.com/post/36149816687</link><guid>http://seanjtaylor.com/post/36149816687</guid><pubDate>Tue, 20 Nov 2012 13:47:00 -0500</pubDate></item></channel></rss>
