How Much CO2 Will Mauna Loa Measure Next Year?
Given every weekly reading since the 1970s, what will the CO2 level at Mauna Loa be over the next 52 weeks? The record climbs every year and rises and falls with the seasons, a good test of any forecast.
The table
Weekly average atmospheric CO2 measured at the Mauna Loa Observatory in Hawaii. It's in Welt's research catalogue as Mauna Loa Weekly Atmospheric CO2 Averages, 2,225 rows by 7 columns, licensed CC0. The catalogue measures its signal at 0.57, in time order. Chronos-2 forecasts the series in one request and needs no training.
Walkthrough
Load it from the catalogue
Find the table, read its recorded target and print the column names.
import pandas as pd from welt import Client, Forecast with Client() as client: item = client.research_datasets(q="Mauna Loa weekly CO2", limit=1)["items"][0] info = client.research_dataset(item["id"]) data = client.load_research_dataset(item["id"]) target = info["targets"][0] target = target["name"] if isinstance(target, dict) else target print([column["name"] for column in info["schema"]], target)Pick the history
Keep the time column and the target.
time = "date" history = data[[time, target]].dropna() history[time] = pd.to_datetime(history[time]) history = history.sort_values(time)Forecast with a range
Ask for the next 52 steps, one per week. The median is the forecast, and the 10% and 90% columns give a low and a high case.
model = Forecast(model="chronos-2").fit(history, time=time, target=[target]) result = model.forecast(52, quantile_levels=[0.1, 0.5, 0.9]) print(result.to_frame()[["timestamp", "median", "q_0.1", "q_0.9"]].head(52))
What you get
Try it
Use Open with to run the research datasets notebook in Colab, Kaggle or Jupyter and search for "Mauna Loa weekly CO2", or run the code above after pip install "welt-client[parquet]".
Open with
- Type
- Use case
- Area
- Climate
- Question
- How Much CO2 Will Mauna Loa Measure Next Year?
- Model
- Chronos-2
- Data
- Mauna Loa Weekly Atmospheric CO2 Averages, 2,225 rows
- For
- Climate scientists, teachers and data journalists
- Licence
- CC0