Showing posts with label Calculus. Show all posts
Showing posts with label Calculus. Show all posts

Sunday, February 21, 2010

Calculating Integrals In The Climate Scientist Starter Kit

Since I showed you how to calculate the derivatives of CO2, I figured I'd show you how to calculate the integral as well. Just like calculating derivatives, calculating integrals is surprisingly easy.

Calculating Integrals In The Climate Scientist Starter Kit
The first thing we need to know is just what an integral is. Another name for integral is "area under the curve", and that's just what an integral is, the area from the bottom of the graph to the place where the lines are. To demonstrate this visually, I plotted a graph that has CO2 twice, once as a line and once as a set of bars. The distance between the bars was set to zero. Here's what the graph looks like:

Image
You can see that when CO2 is plotted as a set of bars, it completely fills up the area under the curve of CO2 plotted as a line. This is exactly what an integral is! So we know there's enough information just from the CO2 values to get the integral. So how do we get the actual number value for the integral?

It's simple. We add up the values for all the bars. This can be done with a simple sum() function:

=SUM(COLUMN_NAME)

Done!

Calculating Integral Ranges
Suppose we want to find the integral of just part of the graph, say between the 5th and 10th months listed. This can be done by taking the integral for each range and subtracting the results.

=SUM(COLUMN_NAME_ROW_1:COLUMN_NAME_ROW_OF_FIRST_VALUE)
=SUM(COLUMN_NAME_ROW_1:COLUMN_NAME_ROW_OF_SECOND_VALUE)
=SECOND_INTEGRAL - FIRST_INTEGRAL

Example:
=SUM(C1:C5)
=SUM(C1:C10)
=SECOND_INTEGRAL - FIRST_INTEGRAL


The first function gives us the integral of columns 1 through 5. The second function gives us the integral of columns 1 through 10. Subtracting the first integral from the second integral gives us the integral of columns 5 through 10.

Previous Posts In This Series:
CO2 Derivatives (Not Al Gore's Kind Of Derivatives)

Friday, February 19, 2010

CO2 Derivatives (Not Al Gore's Kind Of Derivatives)

A few days ago an article appeared on What's Up With That that claimed to have disproven AGW using statistics. That claim seems rather bold to me, but there were aspects of the paper I found interesting.

The paper talked about the "1st differences" and "2nd differences" of CO2. By this, the author meant the 1st and 2nd derivatives of CO2. Here I mean derivative as the term is used in Calculus, not the CO2 financial derivatives Al Gore wants to sell you on his carbon stock exchange.

This post shows how to calculate the 1st and 2nd derivatives of a variable in the Climate Scientist Starter Kit.

Calculating Derivatives In The Climate Scientist Starter Kit
It turns out it's pretty easy to calculate 1st and 2nd derivatives in the Climate Scientist Starter Kit. A derivative is calculated as dy/dx. In English, this means the change in y divided by the change in x. In this case, the term "y" refers to the y axis and "x" refers to the x axis. So you can calculate a derivative with the following spreadsheet formula:

=(Y_Cell - Previous_Y_Cell) / (X_Cell - Previous_X_Cell)

But its actually even easier than that. Because the X axis represents a series of months, the difference between any two adjoining X values is always 1. This simplifies the formula to:

=(Y_Cell - Previous_Y_Cell) / 1

And because the result of any number divided by one is that number, the formula simplifies even further:

=(Y_Cell - Previous_Y_Cell)

And there's our derivative!

Calculating the 2nd derivative is just the process of getting the derivative of the first derivative. In other words, it's just the same (Y_CELL - Previous_Y_Cell) run against the 1st derivative rather than the original data series.

The 1st And 2nd Derivative Of CO2
The graphs below show the CO2 data from the Climate Scientist Starter Kit, and the 1st and 2nd derivatives of that data.

Image
CO2 Data


Image
CO2 1st Derivative


Image

CO2 2nd Derivative

The 1st derivative tells us the rate of change in the amount of CO2. The 2nd derivative tells us the rate of change in the rate of change in the amount of CO2.

Conclusion
Originally, I had planned to show how the 2nd derivative of CO2 has a good match with changes in cosmic rays. To do this you just lay the normalized cosmic rays on the graph with the 2nd derivative of CO2.

I had done this very quickly with a couple of decades of data when I first read the article I mentioned above. The match was very good. The 2nd derivative of CO2 and cosmic rays changed in lockstep with one another. Unfortunately, when I extended the analysis to the full range of data for the purposes of writing this post, the new range didn't have that nice correlation.

So I have no cool correlation to show you, but now you know how to calculate 1st and 2nd derivatives of data in the Climate Scientist Starter Kit. Well, ok, I do have one correlation to show you. It's between the 1st derivative of CO2 and the Solar Ephemeris. A similar correlation also exists with the 2nd derivative of CO2.

Image


References:
New paper on mathematical analysis of GHG
Climate Scientist Starter Kit v1.5