Section 1: The aim of this project

The aim of this project is to explore a time series using Meta’s Prophet forecasting system.

What is Mauna Loa?

Mauna Loa, located on the Big Island of Hawaii, is the world’s largest active shield volcano by volume and area, comprising over half the island. Standing 13,681 feet (4,170 m) above sea level, it rises over 30,000 feet from the ocean floor. It is highly active, with its most recent eruption occurring in November 2022.

Now that we’ve caught up to speed with the beautiful but terrifying gem known as Mauna Loa. Lets get into the knitty gritty nerdy stuff and look at the numbers…

Code

As mentioned before, the aim is to create a time series displaying how the atmospheric conditions in Mauna Loa have changed over time. We do this using the CO2 dataset.

The CO2 dataset contains monthly CO2 concentration values from 1959 to 1997, the data is expressed in parts per million.

We start by importing a forecasting system known as Prophet

## Loading required package: Rcpp
## Loading required package: rlang

Then we use the command data to load specified data sets, in this case the dataset is known as CO2.

We then use the command time to create a vector of times at which a time series was sampled. Conveniently, we can split up the messy data into neat monthly timeframes using yearmon.

##           Jan      Feb      Mar      Apr      May      Jun      Jul      Aug
## 1959 1959.000 1959.083 1959.167 1959.250 1959.333 1959.417 1959.500 1959.583
## 1960 1960.000 1960.083 1960.167 1960.250 1960.333 1960.417 1960.500 1960.583
## 1961 1961.000 1961.083 1961.167 1961.250 1961.333 1961.417 1961.500 1961.583
## 1962 1962.000 1962.083 1962.167 1962.250 1962.333 1962.417 1962.500 1962.583
## 1963 1963.000 1963.083 1963.167 1963.250 1963.333 1963.417 1963.500 1963.583
## 1964 1964.000 1964.083 1964.167 1964.250 1964.333 1964.417 1964.500 1964.583
## 1965 1965.000 1965.083 1965.167 1965.250 1965.333 1965.417 1965.500 1965.583
## 1966 1966.000 1966.083 1966.167 1966.250 1966.333 1966.417 1966.500 1966.583
## 1967 1967.000 1967.083 1967.167 1967.250 1967.333 1967.417 1967.500 1967.583
## 1968 1968.000 1968.083 1968.167 1968.250 1968.333 1968.417 1968.500 1968.583
## 1969 1969.000 1969.083 1969.167 1969.250 1969.333 1969.417 1969.500 1969.583
## 1970 1970.000 1970.083 1970.167 1970.250 1970.333 1970.417 1970.500 1970.583
## 1971 1971.000 1971.083 1971.167 1971.250 1971.333 1971.417 1971.500 1971.583
## 1972 1972.000 1972.083 1972.167 1972.250 1972.333 1972.417 1972.500 1972.583
## 1973 1973.000 1973.083 1973.167 1973.250 1973.333 1973.417 1973.500 1973.583
## 1974 1974.000 1974.083 1974.167 1974.250 1974.333 1974.417 1974.500 1974.583
## 1975 1975.000 1975.083 1975.167 1975.250 1975.333 1975.417 1975.500 1975.583
## 1976 1976.000 1976.083 1976.167 1976.250 1976.333 1976.417 1976.500 1976.583
## 1977 1977.000 1977.083 1977.167 1977.250 1977.333 1977.417 1977.500 1977.583
## 1978 1978.000 1978.083 1978.167 1978.250 1978.333 1978.417 1978.500 1978.583
## 1979 1979.000 1979.083 1979.167 1979.250 1979.333 1979.417 1979.500 1979.583
## 1980 1980.000 1980.083 1980.167 1980.250 1980.333 1980.417 1980.500 1980.583
## 1981 1981.000 1981.083 1981.167 1981.250 1981.333 1981.417 1981.500 1981.583
## 1982 1982.000 1982.083 1982.167 1982.250 1982.333 1982.417 1982.500 1982.583
## 1983 1983.000 1983.083 1983.167 1983.250 1983.333 1983.417 1983.500 1983.583
## 1984 1984.000 1984.083 1984.167 1984.250 1984.333 1984.417 1984.500 1984.583
## 1985 1985.000 1985.083 1985.167 1985.250 1985.333 1985.417 1985.500 1985.583
## 1986 1986.000 1986.083 1986.167 1986.250 1986.333 1986.417 1986.500 1986.583
## 1987 1987.000 1987.083 1987.167 1987.250 1987.333 1987.417 1987.500 1987.583
## 1988 1988.000 1988.083 1988.167 1988.250 1988.333 1988.417 1988.500 1988.583
## 1989 1989.000 1989.083 1989.167 1989.250 1989.333 1989.417 1989.500 1989.583
## 1990 1990.000 1990.083 1990.167 1990.250 1990.333 1990.417 1990.500 1990.583
## 1991 1991.000 1991.083 1991.167 1991.250 1991.333 1991.417 1991.500 1991.583
## 1992 1992.000 1992.083 1992.167 1992.250 1992.333 1992.417 1992.500 1992.583
## 1993 1993.000 1993.083 1993.167 1993.250 1993.333 1993.417 1993.500 1993.583
## 1994 1994.000 1994.083 1994.167 1994.250 1994.333 1994.417 1994.500 1994.583
## 1995 1995.000 1995.083 1995.167 1995.250 1995.333 1995.417 1995.500 1995.583
## 1996 1996.000 1996.083 1996.167 1996.250 1996.333 1996.417 1996.500 1996.583
## 1997 1997.000 1997.083 1997.167 1997.250 1997.333 1997.417 1997.500 1997.583
##           Sep      Oct      Nov      Dec
## 1959 1959.667 1959.750 1959.833 1959.917
## 1960 1960.667 1960.750 1960.833 1960.917
## 1961 1961.667 1961.750 1961.833 1961.917
## 1962 1962.667 1962.750 1962.833 1962.917
## 1963 1963.667 1963.750 1963.833 1963.917
## 1964 1964.667 1964.750 1964.833 1964.917
## 1965 1965.667 1965.750 1965.833 1965.917
## 1966 1966.667 1966.750 1966.833 1966.917
## 1967 1967.667 1967.750 1967.833 1967.917
## 1968 1968.667 1968.750 1968.833 1968.917
## 1969 1969.667 1969.750 1969.833 1969.917
## 1970 1970.667 1970.750 1970.833 1970.917
## 1971 1971.667 1971.750 1971.833 1971.917
## 1972 1972.667 1972.750 1972.833 1972.917
## 1973 1973.667 1973.750 1973.833 1973.917
## 1974 1974.667 1974.750 1974.833 1974.917
## 1975 1975.667 1975.750 1975.833 1975.917
## 1976 1976.667 1976.750 1976.833 1976.917
## 1977 1977.667 1977.750 1977.833 1977.917
## 1978 1978.667 1978.750 1978.833 1978.917
## 1979 1979.667 1979.750 1979.833 1979.917
## 1980 1980.667 1980.750 1980.833 1980.917
## 1981 1981.667 1981.750 1981.833 1981.917
## 1982 1982.667 1982.750 1982.833 1982.917
## 1983 1983.667 1983.750 1983.833 1983.917
## 1984 1984.667 1984.750 1984.833 1984.917
## 1985 1985.667 1985.750 1985.833 1985.917
## 1986 1986.667 1986.750 1986.833 1986.917
## 1987 1987.667 1987.750 1987.833 1987.917
## 1988 1988.667 1988.750 1988.833 1988.917
## 1989 1989.667 1989.750 1989.833 1989.917
## 1990 1990.667 1990.750 1990.833 1990.917
## 1991 1991.667 1991.750 1991.833 1991.917
## 1992 1992.667 1992.750 1992.833 1992.917
## 1993 1993.667 1993.750 1993.833 1993.917
## 1994 1994.667 1994.750 1994.833 1994.917
## 1995 1995.667 1995.750 1995.833 1995.917
## 1996 1996.667 1996.750 1996.833 1996.917
## 1997 1997.667 1997.750 1997.833 1997.917
## 
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
## 
##     as.Date, as.Date.numeric

Now, we create a dataframe using the command data.frame. Then we use the forecaster prohpet to extrapolate some future data for 8 months ahead of the end date of the CO2 dataset.

For a quick sidenote, we assume there is not any daily or weekly seasonality here.

## Disabling weekly seasonality. Run prophet with weekly.seasonality=TRUE to override this.
## Disabling daily seasonality. Run prophet with daily.seasonality=TRUE to override this.

Time Series Analysis: CO₂ Concentration at Mauna Loa

Finally, we plot our data as a time series to show the changes

plot(WeatherForecaster, Prediction)

Long-term trend

The most prominent feature of the time series is a strong upward trend in atmospheric CO₂ concentrations over the observed period. At the beginning of the series in the late 1950s, CO₂ levels are approximately 315 ppm, while by the late 1990s they approach 365–370 ppm.

This steady increase indicates that atmospheric CO₂ has been accumulating over time. The increase appears approximately linear to slightly accelerating, suggesting that the rate of emissions into the atmosphere has been persistent and potentially increasing. To take a few guesses, this change in atmospheric CO2 levels is likely due to:

-Fossil fuel combustion -Volcanic activity -Deforestation and land-use change in the surrounding area

The overall increase of roughly 50 ppm over about four decades represents a substantial change in atmospheric composition and highlights the long-term impact of human and volcanic activity on the global carbon cycle.

Seasonal Pattern

There is a clear and consistent seasonal cycle, visible as repeating peaks and troughs each year. These oscillations occur roughly once every 12 months, indicating strong annual seasonality.The seasonal fluctuations are caused mainly by biological processes.

Spring and Summer: During the growing season, plants absorb CO₂ through photosynthesis, causing atmospheric CO₂ concentrations to decline.

Autumn and Winter: As plants die back and photosynthesis decreases, respiration and decomposition release CO₂ back into the atmosphere, causing concentrations to rise.

This creates the characteristic saw-tooth pattern observed in the graph.

Variability and noise

Aside from the dominant trend and seasonal cycle, the data shows minimal irregular fluctuations or random noise. The observations appear smooth and consistent, indicating:

-High measurement reliability -Stable monitoring procedures -Limited short-term disturbances affecting the data

Any noise is negligible relative to the magnitude of the trend and seasonal variation.

An overview

The data has a persistent upward trajectory in CO₂ concentration over time. For the seasonality, it has a strong annual seasonal cycle with regular peaks and troughs.In terms of noise, there are mall random fluctuations around the trend-seasonal structure.

Because of the strong trend, the series is non-stationary, meaning its mean changes over time.