09 August 2007

80-degree lows in Philadelphia

I find myself interested in the weather, both because my main means of transportation is walking, and because it's a complex system that enough other people are interested in that they try to predict it and which is a source of large data sets. (Surprisingly, I have no weather-forecasting ability. I figure I could learn how if I wanted to, but I'm not that curious, because I'd just be discouraged when I realized the professionals are better than me at it.) It hit 97 here in Philadelphia yesterday; more crazy-sounding is that Wednesday morning's low was 80 degrees. This has only happened 39 40 times in recorded Philadelphia weather history, i. e. since 1876.

I find myself wondering how the number of such days is distributed, but it's hard to come to any sort of conclusion. My instinct, though, is something like this: the number of clusters of 80-degree lows (that is, consecutive days with them) in a given summer is probably Poisson-distributed.

Of course, counting these "clusters" is a silly thing to do, because it seems to imply that, say, the lows on August 16, 2002 and August 18, 2002 (both 80 degrees) are independent events, just because it didn't get up to eighty on August 17. (The low that day was 77.) If you look at the data, there have been 109 summers with no 80-degree lows, 20 summers with one cluster of them, one summer with two clusters, and two summers with three clusters; that last one makes me suspicious, but one of those is 2002 (July 30, August 16, August 18) and one is 1995 (July 15, 26, 29).

Second, how long is each individual cluster? There are 19 clusters of length 1, 7 of length 2, and 2 of length 3; I'm inclined to suggest a geometric distribution. Once there's an 80-degree low, the probability of having an 80-degree low on the next day is a constant, approximately 1/4. It seems reasonable that this probability would be less than 1/2 but not too much less; an 80-degree low in Philadelphia is very unusual, so the next day is expected to be a bit cooler. I've heard that the simplest weather-forecasting rule is that "tomorrow will be like today". I suspect that a slightly better rule is "tomorrow will be like today, but a little less so" -- that is, it will regress to the mean a bit. But to apply this rule one has to have some idea what the mean is. On a day with a high of 70 in Philadelphia in July I'd want this rule to predict the next day would be warmer; on the same day in November I'd want it to predict the next day would be colder.

So the number of 80-degree days in a given summer, I expect, is the sum of some number of geometrically distributed variables with p = 3/4, the number of such variables being given by a Poisson distribution with mean about .21 (there were 28 observed clusters in 132 years). Determining what this says in terms of actual probabilities is left as an exercise for the reader, mostly because I don't trust these numbers enough. It seems like a reasonable first stab at a model, though. It only has any chance of working for extreme temperatures, though; if I replaced 80 with 70 (the average low in Philly this time of year) then the model wouldn't work so well, because it depends on this clustering phenomenon. (The highest-recorded low temperature ever in Philadelphia is 82, so you can see that 80 is extreme.)

While I'm on the subject of weather, check out weatherbonk.com, which displays the weather, live, on a map, showing the temperature at various volunteer-run weather stations. I'm never sure how much to trust any of these stations, though, because you hear that sometimes they're in an asphalt-paved parking lot next to the place where the heat comes out for a central AC unit. I suspect it would be more interesting in a place like San Francisco where the microclimates are pronounced enough that you can see them even over that noise.