sat, 08-nov-2014, 10:43

bridge and back cabin, low snow

Winter started off very early this year with the first snow falling on October 4th and 5th, setting a two inch base several weeks earlier than normal. Since then, we’ve had only two days with more than a trace of snow.

This seems to be a common pattern in Fairbanks. After the first snowfall and the establishment of a thin snowpack on the ground, we all get excited for winter and expect the early snow to continue to build, filling the holes in the trails and starting the skiing, mushing and winter fat biking season. Then, nothing.

Analysis

I decided to take a quick look at the pattern of snow depth at the Fairbanks Airport station to see how uncommon it is to only have two inches of snow this late in the winter (November 8th at this writing). The plot below shows all of the snow depth data between November and April for the airport station, displayed as box and whisker plots.

Here’s the SQL:

```SELECT extract(year from dte) AS year,
extract(month from dte) AS month,
to_char(dte, 'MM-DD') AS mmdd,
round(snwd_mm/25.4, 1) AS inches
FROM ghcnd_pivot
WHERE station_name = 'FAIRBANKS INTL AP'
AND snwd_mm IS NOT NULL
AND (extract(month from dte) BETWEEN 11 AND 12
OR extract(month from dte) BETWEEN 1 AND 4);
```

If you’re interested in the code that produces the plot, it’s at the bottom of the post. If the plot doesn’t show up in your browser or you want a copy for printing, here’s a link to the PDF version.

Box and whisker plots

For those unfamiliar with these, they’re a good way to evaluate the range of data grouped by some categorical variable (date, in our case) along with details about the expected values and possible extremes. The upper and lower limit of each box show the ranges where 25—75% of the data fall, meaning that half of all observed values are within this box for each date. For example, on today’s date, November 8th, half of all snow depth values for the period in question fell between four and eight inches. Our current snow depth of two inches falls below this range, so we can say that only having two inches of snow on the ground happens in less than 25% of the time.

The horizontal line near the middle of the box is the median of all observations for that date. Median is shown instead of average / mean because extreme values can skew the mean, so a median will often be more representative of the most likely value. For today’s date, the median snow depth is five inches. That’s what we’d expect to see on the ground now.

The vertical lines extending above and below the boxes show the points that are within 1.5 times the range of the boxes. These lines represent the values from the data outside the most likely, but not very unusual. If you scan across the November to December portion of the plot, you can see that the lower whisker touches zero for most of the period, but starting on December 26th, it rises above zero and doesn’t return until the spring. That means that there have been years where there was no snow on the ground on Christmas. Ouch.

The dots beyond the whiskers are outliers; observations so far from what is normal that they’re exceptional and not likely to be repeated. On this plot, most of these outliers are probably from one or two exceptional years where we got a ton of snow. Some of those outliers are pretty incredible; consider having two and a half feet of snow on the ground at the end of April, for example.

Conclusion

The conclusion I’d draw from comparing our current snow depth of two inches against the boxplots is that it is somewhat unusual to have this little snow on the ground, but that it’s not exceptional. It wouldn’t be unusual to have no snow on the ground.

Looking forward, we would normally expect to have a foot of snow on the ground by mid-December, and I’m certainly hoping that happens this year. But despite the probabilities shown on this plot it can’t say how likely that is when we know that there’s only two inches on the ground now. One downside to boxplots in an analysis like this is that the independent variable (date) is categorical, and the plot doesn’t have anything to say about how the values on one day relate to the values on the next day or any date in the future. One might expect, for example, that a low snow depth on November 8th means it’s more likely we’ll also have a low snow depth on December 25th, but this data can’t offer evidence on that question. It only shows us what each day’s pattern of snow depth is expected to be on it’s own.

Bayesian analysis, “given a snow depth of two inches on November 8th, what is the likelihood of normal snow depth on December 25th”, might be a good approach for further investigation. Or a more traditional regression analysis examining the relationship between snow depth on one date against snow depth on another.

Appendix: R Code

```library(RPostgreSQL)
library(ggplot2)
library(scales)
library(gtable)

# Build plot "table"
make_gt <- function(nd, jf, ma) {
gt1 <- ggplot_gtable(ggplot_build(nd))
gt2 <- ggplot_gtable(ggplot_build(jf))
gt3 <- ggplot_gtable(ggplot_build(ma))
max_width <- unit.pmax(gt1\$widths[2:3], gt2\$widths[2:3], gt3\$widths[2:3])
gt1\$widths[2:3] <- max_width
gt2\$widths[2:3] <- max_width
gt3\$widths[2:3] <- max_width
gt <- gtable(widths = unit(c(11), "in"), heights = unit(c(3, 3, 3), "in"))
gt <- gtable_add_grob(gt, gt1, 1, 1)
gt <- gtable_add_grob(gt, gt2, 2, 1)
gt <- gtable_add_grob(gt, gt3, 3, 1)

gt
}

drv <- dbDriver("PostgreSQL")
con <- dbConnect(drv, dbname="DBNAME")
results <- dbGetQuery(con,
"SELECT extract(year from dte) AS year,
extract(month from dte) AS month,
to_char(dte, 'MM-DD') AS mmdd,
round(snwd_mm/25.4, 1) AS inches
FROM ghcnd_pivot
WHERE station_name = 'FAIRBANKS INTL AP'
AND snwd_mm IS NOT NULL
AND (extract(month from dte) BETWEEN 11 AND 12
OR extract(month from dte) BETWEEN 1 AND 4);")
results\$mmdd <- as.factor(results\$mmdd)
# NOV DEC
nd <- ggplot(data=subset(results, month == 11 | month == 12), aes(x=mmdd, y=inches)) +
geom_boxplot() +
theme_bw() +
theme(axis.title.x = element_blank()) +
theme(plot.margin = unit(c(1, 1, 0, 0.5), 'lines')) +
# scale_x_discrete(name="Date (mm-dd)") +
scale_y_discrete(name="Snow depth (inches)", breaks=pretty_breaks(n=10)) +
theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
ggtitle('Snow depth by date, Fairbanks Airport, 1917-2013')
# JAN FEB
jf <- ggplot(data=subset(results, month == 1 | month == 2), aes(x=mmdd, y=inches)) +
geom_boxplot() +
theme_bw() +
theme(axis.title.x = element_blank()) +
theme(plot.margin = unit(c(0, 1, 0, 0.5), 'lines')) +
# scale_x_discrete(name="Date (mm-dd)") +
scale_y_discrete(name="Snow depth (inches)", breaks=pretty_breaks(n=10)) +
theme(axis.text.x = element_text(angle = 45, hjust = 1)) # +
# ggtitle('Snowdepth by date, Fairbanks Airport, 1917-2013')
# MAR APR
ma <- ggplot(data=subset(results, month == 3 | month == 4), aes(x=mmdd, y=inches)) +
geom_boxplot() +
theme_bw() +
theme(plot.margin = unit(c(0, 1, 1, 0.5), 'lines')) +
scale_x_discrete(name="Date (mm-dd)") +
scale_y_discrete(name="Snow depth (inches)", breaks=pretty_breaks(n=10)) +
theme(axis.text.x = element_text(angle = 45, hjust = 1)) # +
# ggtitle('Snowdepth by date, Fairbanks Airport, 1917-2013')

gt <- make_gt(nd, jf, ma)
svg("snowdepth_boxplots.svg", width=11, height=9)
grid.newpage()
grid.draw(gt)
dev.off()
```
Meta Photolog Archives