Sunday 18 November 2012

(Geo) Visualizing the NHL Lockout

If you are like me the current NHL lockout is tearing your heart out. One good thing that has come from it however is this map titled Getting Ice Time by Kevin Hibma, a software engineer at ESRI -  the maker of the uber-popular GIS software suite ArcGIS.


The map Getting Ice Time by Kevin Hibma shows the movement of NHL players from North American teams and cities to European teams and cities during the present NHL lockout.
The map is dynamic so that when you click on a line you bring up some background information, including NHL salary, about individual players. When you click on a point symbol, it gives you information about the team situated there (e.g., the buildint they play in, etc.).
 
Each red star depicts the location of the 30 NHL teams, while the orange stars represent minor-league and junior affiliates. Many young players have moved from their current NHL teams minor-leauge affiliate team - some even going back to the junior ranks - during the lockout to hone their skills and get some more ice time. The movement of these players is shown using orange lines for players going to the minors, and yellow lines for players returning to the junior leagues.
 
As you can see the map is dominated by green lines, representing players moving overseas to play in the European professional leagues. A number of European NHLers have returned to the teams they grew up watching, but many North American born players have also decided to play in Europe.
The colors and symbols (circles and squares) are used to depict the different leauges. For example the Russian league (KHL) is shown using red circles. Each icon represents a team location, so note that not all teams have added locked-out NHL players to their rosters. The map also includes some social media links (tweets and facebook) related to the NHL lockoout that you can click on and read/view.
 
The lines on the map are shown using great circle routes, which represent the shortest distance as-the-crow-flies between the two locations on the globe. The use of great circle route lines make for a pleasing visualization, one you may be familiar with from back-of-the-seat airplane magazines.
 
Overall, just a really cool map showing a bunch of information about players involved in the NHL lockout which can be used to learn more about professional hockey teams abroad. An article on ESPN.com has featured this map, along with some comments from the creator. Thanks to my pal Ben Stewart who passed the link on to me.
 
Nice job Kevin!
 

Friday 14 September 2012

Spatial Analysis of Tennis

Recently, Damien Demaj - a cartographer working for ESRI, published a neat piece of work using geovisual analytics to explore the Gold medal match in mens tennis from the 2012 Olympics in London. This match was, of course, between the legendary Roger Federer (holder of 17 grand-slam titles) and hometown favorite Andy Murray. In case you've been living under a rock, the game was eventually won by Murray.

The maps Demaj created combined movement data of the individuals, along with locations of where winning shots were taken. (see below)

Portraying movement data in a single plot/map can be incredibly messy when dealing with large datasets. Even more messy, is the map that includes not only player movement and winning shot location, but that of all shots, and the trajectory path of each of those shots. (see below)

 
This of course is an even messier clump of data, making it difficult to discern if spatial patterns are evident. To desiminate the data in a more usable form, Demaj depicts the winning shots (often termed winners) with at least three strokes, of Murray (n = 18) and Federer (n = 13) indivdually .

From these maps, Demaj is able to make some interesting spatial inferences. First, Murray scored several down-the-line backhand winners. Murray also connected on several winners from deep in the court (near the service line). Federer, on the other hand, was most successful by getting Murray deep or wide from his service game (10 / 13 winners!). What a nice piece of work by D. Demaj, and an even cooler spatial sports dataset.
 
What other types of questions could be investigated with this type of data? Well, I would be interested in seeing if individual players had characteristic spatial patterns as to where they hit shots. Methods from point pattern analysis (e.g., kernel density estimation) could be used to derive smooth surface of shot location intensity (essentially a heat map of shot locations). This could be a useful long-term statistic to keep on players to determine if they have spatial preferences in shot making, especially if grouped by situational context (e.g., backhand vs. forehand). Alternatively, the player movements could be incorporated into a movement heat map to see if movement patterns emerge. Finally, I think an interesting spatial metric to explore with tennis is the distance-to-out-of-bounds of each shot. Such a metric may be able to identify those players capable of hitting the ball closer to out-of-bound (painting the lines so to speak!) as a measure of overall shot effectiveness.
 
Check out more from Damien Demaj by following him on twitter: @damiendemaj
 




Wednesday 20 June 2012

Some Thoughts on Heat Mapping

From the all-knowing Wikipedia, a heat map can be defined broadly as:
"a graphical representation of data where the individual values contained in a matrix are represented as colors."
A couple of things, first, it is a graphical representation of data.  Second, in spatial applications location is defined by the matrix in the above definition. Finally, representation is done using colors. Heat maps have been used to visualize data in a wide variety of sports applications, for example, pitch location charts in baseball, shot location charts in basketball and hockey, and player movements in soccer.

Typically, the value of the heat map at a given location is defined by a count or a proportion of a count that is successful. This takes an ecological perspective, whereby spatial units are analogous to quadrats (although they need not be square!). In some datasets, the size of the quadrat will be limited by the spatial resolution associated with the data, for those of you familiar with GIS or cartography, this can be interpreted as the minimum mapping unit.

Recently, some of Kirk Goldsberry's nice work on mapping basketball has been featured by major US news networks (for example, the NY Times). In this analysis heat maps are used to visualize and compare the shot frequency and success rates of the 2012 NBA Championship finalists, the Miami Heat and Oklahoma City Thunder, along with specific analysis of the key players in the series, including superstars Lebron James and Kevin Durant. Goldsberry uses heat-maps to effectively visualize differences in the spatial patterning of field goal attempts between the two teams overall, and between individual players (see image from that article below, comparing the Heat vs. Thunder).

What I love about this particular piece of work is that it is able to represent two variables within a single heat map. Shot frequency is displayed using the size of the hexagons (not a square spatial unit!), and shot efficacy (defined as points per field goal attempt) is displayed using color. It makes for a really effective way to visualize these two aspects of field goal shooting. This makes interpreting the results also more informative, as we have more confidence in the values represented by larger hexagons.

In spatial statistics, this type of analysis falls under the category of spatial point pattern analysis. The underlying shot location representing a spatial point pattern with the number points scored with each shot representing a stored attribute (this special case is termed a marked point pattern). In a future post, I will discuss some common pitfalls encountered in spatial point pattern analysis, along with some statistical techniques for generating alternative forms of "heat maps".

Monday 21 May 2012

Some Cool Spatial Sports Links

Spatial Analysis of Tennis by Damien Demaj

Sweet link to mapping basketball by Kirk Goldsberry.

Michael Schuckers work on rating goalies in Hockey which builds upon his shot probability maps.

Tonnes of stuff out there on heat maps in soccer (e.g., here).

The ESPN website actually contains a lot of spatial data (e.g., Basketball shot charts).

Fox Sports has nice hit chart data for baseball players (e.g., Jose Bautista).

Baseball strikezone heat maps also count, even though the spatial domain is not geographical per se (e.g., from fangraphs).

Spatial analysis on the role of travel distances on team success in March Madness.

Know of any other great websites doing spatial sports analytics, or other interesting pieces of spatial sports data? Post a comment and I'll add them to the list.





Saturday 19 May 2012

Introduction: Why "Spatial" Sports Analytics?

I'm a PhD Candidate in Geography at the University of Victoria in Victoria, British Columbia, Canada. My dissertation involves the development of quantitative methods for studying things that move. Most of my work has centered on spatial ecology and wildlife movement, but the tools and methods I employ can also be applied to other application areas, for example athlete movement. Further, I have a fundamental interest in spatial analysis and GIS, and I hope to apply the skills that I have in these areas to investigate those sports analytics problems that involve a spatial perspective.

I've created this blog to share my musings on the why spatial concepts are really important drivers in some of the different patterns we see in a variety of sports; but more importantly to foster the correct usage and understanding of spatial analysis techniques in sports analytics. In doing so, I hope to provide ideas, examples, and links involving tools, methods, datasets, and most importantly interesting questions involving the study of spatial concepts in sports analytics research.

Hope you enjoy!

Jed A. Long