Tuesday, April 7, 2015

Dynamic trend viewer

This was intended as a graphic facility for my post on GHCN data. However, alas, there was mission creep, and a dynamic trend viewer, in the style of the trend viewer page, emerged. It's "dynamic" because it is all in Javascript. I don't have to pre-calculate and store images. This is fine for annual data - calc time might be a problem for monthly. But the style of access also gives a rapid response which is fun to play with.

As with the trend page, I show a graph of the time series. Data options supplied are the usual collection of global temperatures, but you can also supply your own. And there is a color triangle, in which each dot (square) is a start/end year combination, with the color showing the corresponding trend. With the trend page, you could click on that to change the range; there were also controls in the graph. Now you just run the mouse over the triangle, and the red trend line on the plot moves dynamically, and the information is echoed top right. The triangle is oriented so the NE corner is starting ending 2014, and SE is the whole range. x axis is start year, y-axis is end year. The info in the upper triangle will tell you where you are.

I haven't given a color key, because you get an instant print response - basically, rainbow with red for warming. To change data set, select from the menu and then press the "Enter data" button. To enter your own, just convert it to a comma separated one-line list, and paste into the text window, and then click "Enter Data". The button enters the last thing you changed (text window or selector). If you enter data, it is attached to the choice "User Data" in the data menu. Initially, I have put a sinusoid there, which you can select. It shows graphically how the trend works as a derivative.

So here is the gadget:


The CI's are, like the trend page, calculated as AR(1) autocorrelated series using the Quenouille approx. Usually correlation is less for annual data. I have shown trends of all lengths, but too short trends will have unreliable or NaN CI's.




0 comments:

Post a Comment