<h2>The problem</h2>
<p>I am trying to figure out how <span class="math-container">$\ce{CO2}$</span> concentration trends are computed in the data provided by the Earth Systems Research Laboratory Mauna Loa Observatory. The data contains monthly measurements, seasonally corrected trend, and interpolated data with filled gaps. The trend and interpolated data should be computable from the raw averages. I was trying to reproduce the results of computing the trend and interpolation, but my values keep being slightly off.</p>
<p>I have tried two formulas to compute the
trend that I call <em>formula1</em> and <em>formula2</em> below and neither reproduces the data exactly, though formula2 seems to fit pretty well.</p>
<p><img src="https://i.sstatic.net/YVNu9.png" alt="enter image description here" /></p>
<h2>The data</h2>
<p>The data <a href="http://www.esrl.noaa.gov/gmd/ccgg/trends/" rel="nofollow noreferrer">(esrl.noaa.gov)</a> is made available as a text file structured as follows:</p>
<pre><code>#  (-99.99 missing data;  -1 no data for #daily means in month)
#
#            decimal     average   interpolated    trend    #days
#             date                             (season corr)
1958   3    1958.208      315.71      315.71      314.62     -1
1958   4    1958.292      317.45      317.45      315.29     -1
1958   5    1958.375      317.50      317.50      314.71     -1
1958   6    1958.458      -99.99      317.10      314.85     -1
   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 
</code></pre>
<p>Here <em>average</em> is the average from monthly measurements of <span class="math-container">$\ce{CO2}$</span> concentration in ppm units, <em>#days</em> is the number of valid days' measurements per month if available.</p>
<p>The other two columns, <em>interpolated</em> and <em>trend</em> are a bit more involved. The file describes the method to compute the values as follows.</p>
<blockquote>
<p>The &quot;interpolated&quot; column includes average values from the preceding column
and interpolated values where data are missing.  Interpolated values are
computed in two steps.  <strong>First</strong>, we compute for each month the average seasonal
cycle in a 7-year window around each monthly value.  In this way the seasonal
cycle is allowed to change slowly over time.  We then determine the &quot;trend&quot;
value for each month by removing the seasonal cycle; this result is shown in
the &quot;trend&quot; column.  Trend values are linearly interpolated for missing months.
The interpolated monthly mean is then the sum of the average seasonal cycle
value and the trend value for the missing month.</p>
</blockquote>
<h2>The formulas</h2>
<p>In order to avoid dealing with boundary effects I compare the results past the first 3.5 years of record, so that centered 7-year windows can be correctly defined. That is starting from September 1961.</p>
<p>Let <span class="math-container">$x_t, t=1..N$</span> be the monthly average values.</p>
<p>I need to first compute &quot;<em>the average seasonal
cycle in a 7-year window around each monthly value</em>&quot;. And then substract it from the data to obtain the trend.</p>
<p>As I understand the average seasonal cycle is the difference between the seasonal filter and some seasonal average.</p>
<p>To compute the 7-year seasonal filter for each <span class="math-container">$t \geq 3*12 + 6$</span> I compute <span class="math-container">$s_t = \frac{1}{7}\Sigma_{j=-3}^{j=3}x_{t+12j}$</span>.</p>
<p>Now for a seasonal average I tried two options.</p>
<ol>
<li>The 7-year seasonal filter average
<span class="math-container">$f_t=\frac{1}{12}\Sigma_{j=0}^{j=11}s_{t+j}$</span></li>
<li>The 7-year average <span class="math-container">$a_t=\frac{1}{84}\Sigma_{j=-42}^{j=41}x_{t+j}$</span></li>
</ol>
<p>Thereby <em>formula1</em> is <span class="math-container">$x_t-(s_t-f_t)$</span> and <em>formula2</em> is <span class="math-container">$x_t-(s_t-a_t)$</span>.</p>
<h2>Conclusion</h2>
<p>It seems to me that I misunderstand what is meant by &quot;<em>the average seasonal
cycle in a 7-year window around each monthly value</em>&quot;. Neither <span class="math-container">$(s_t-f_t)$</span>, nor <span class="math-container">$(s_t-a_t)$</span> defined above fit. What is the correct formula?</p>
<p>I have put the data into a read-only (<a href="https://docs.google.com/spreadsheets/d/1D1ndBLGDfF5t65754HiXE_bVtgNwR1GDvwOFOCJ7J2A/edit?usp=sharing" rel="nofollow noreferrer">Google sheet</a>) for a quick check.</p>

CC BY-SA 4.0
2021-06-02T07:53:27.850Z
somewhat related: [ppmV versus μmol/mol for atmospheric CO2 - how to convert?](https://earthscience.stackexchange.com/q/10157/6031) less related: [What are these Gizmos at Mauna Loa Observatory?](https://earthscience.stackexchange.com/q/16478/6031)
uhoh
CC BY-SA 4.0
2021-09-13T03:11:38.117Z
Have you tried to contact the dataset maintainer? I'm not 100% sure but that might be Pieter Tans (Pieter.Tans at noaa dot gov)
Alex
<atmosphere><geochemistry><volcanology><co2><statistics>
How are Mauna Loa $\ce{CO2}$ monthly trends computed?
Dima Chubarov
# How are Mauna Loa $\ce{CO2}$ monthly trends computed?

(Asked by: username_0 on 2015-02-04)

## The problem

I am trying to figure out how $\ce{CO2}$ concentration trends are computed in the data provided by the Earth Systems Research Laboratory Mauna Loa Observatory. The data contains monthly measurements, seasonally corrected trend, and interpolated data with filled gaps. The trend and interpolated data should be computable from the raw averages. I was trying to reproduce the results of computing the trend and interpolation, but my values keep being slightly off.

I have tried two formulas to compute the
trend that I call *formula1* and *formula2* below and neither reproduces the data exactly, though formula2 seems to fit pretty well.

![enter image description here](https://i.sstatic.net/YVNu9.png)

## The data

The data [(esrl.noaa.gov)](http://www.esrl.noaa.gov/gmd/ccgg/trends/) is made available as a text file structured as follows:

```
#  (-99.99 missing data;  -1 no data for #daily means in month)
#
#            decimal     average   interpolated    trend    #days
#             date                             (season corr)
1958   3    1958.208      315.71      315.71      314.62     -1
1958   4    1958.292      317.45      317.45      315.29     -1
1958   5    1958.375      317.50      317.50      314.71     -1
1958   6    1958.458      -99.99      317.10      314.85     -1
   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 

```

Here *average* is the average from monthly measurements of $\ce{CO2}$ concentration in ppm units, *#days* is the number of valid days' measurements per month if available.

The other two columns, *interpolated* and *trend* are a bit more involved. The file describes the method to compute the values as follows.

> The "interpolated" column includes average values from the preceding column
> and interpolated values where data are missing. Interpolated values are
> computed in two steps. **First**, we compute for each month the average seasonal
> cycle in a 7-year window around each monthly value. In this way the seasonal
> cycle is allowed to change slowly over time. We then determine the "trend"
> value for each month by removing the seasonal cycle; this result is shown in
> the "trend" column. Trend values are linearly interpolated for missing months.
> The interpolated monthly mean is then the sum of the average seasonal cycle
> value and the trend value for the missing month.

## The formulas

In order to avoid dealing with boundary effects I compare the results past the first 3.5 years of record, so that centered 7-year windows can be correctly defined. That is starting from September 1961.

Let $x\_t, t=1..N$ be the monthly average values.

I need to first compute "*the average seasonal
cycle in a 7-year window around each monthly value*". And then substract it from the data to obtain the trend.

As I understand the average seasonal cycle is the difference between the seasonal filter and some seasonal average.

To compute the 7-year seasonal filter for each $t \geq 3\*12 + 6$ I compute $s\_t = \frac{1}{7}\Sigma\_{j=-3}^{j=3}x\_{t+12j}$.

Now for a seasonal average I tried two options.

1. The 7-year seasonal filter average
   $f\_t=\frac{1}{12}\Sigma\_{j=0}^{j=11}s\_{t+j}$
2. The 7-year average $a\_t=\frac{1}{84}\Sigma\_{j=-42}^{j=41}x\_{t+j}$

Thereby *formula1* is $x\_t-(s\_t-f\_t)$ and *formula2* is $x\_t-(s\_t-a\_t)$.

## Conclusion

It seems to me that I misunderstand what is meant by "*the average seasonal
cycle in a 7-year window around each monthly value*". Neither $(s\_t-f\_t)$, nor $(s\_t-a\_t)$ defined above fit. What is the correct formula?

I have put the data into a read-only ([Google sheet](https://docs.google.com/spreadsheets/d/1D1ndBLGDfF5t65754HiXE_bVtgNwR1GDvwOFOCJ7J2A/edit?usp=sharing)) for a quick check.

**Tags:** atmosphere, geochemistry, volcanology, co2, statistics

> **Comments:**
> **username_1**: somewhat related: [ppmV versus μmol/mol for atmospheric CO2 - how to convert?](https://earthscience.stackexchange.com/q/10157/6031) less related: [What are these Gizmos at Mauna Loa Observatory?](https://earthscience.stackexchange.com/q/16478/6031)  
> **username_2**: Have you tried to contact the dataset maintainer? I'm not 100% sure but that might be Pieter Tans (Pieter.Tans at noaa dot gov)  

---

## 0 answers

