In many applications for time series analysis we are interested in the behavior of a time series, but without short-term fluctuations. Smoothing or low-pass filtering are methods to accomplish this task. In time series analysis these methods are especially useful because by applying a low-pass filtering overall trends and/or deviations from the overall trend become more easily detectable.

For the purpose of demonstration we discuss some smoothing methods by applying them to the global mean monthly temperature anomalies provided by the Berkeley Earth Surface Temperature Study. Revisit the section on data sets used to remind yourself how we downloaded and extracted the data of interest.

First, we load to data set (t_global), examine its structure and then we plot it.

library(xts)
load(url("https://userpage.fu-berlin.de/soga/data/r-data/Earth_Surface_Temperature.RData"))

str(t_global)
## An xts object on Jan 1750 / Jun 2022 containing: 
##   Data:    double [3270, 2]
##   Columns: Monthly_Anomaly_Global, Monthly_Unc_Global
##   Index:   yearmon [3270] (TZ: "UTC")
plot(t_global[, "Monthly_Anomaly_Global"],
  main = "Earth Surface Temperature Anomalies"
)

Temperatures are given in Celsius and are reported as anomalies relative to the period January 1951 to December 1980 average.

Exercise: Subset the time series to the period from 1850 until 2015 and plot it.

## Your code here...
temp_global <- NULL
Show code
temp_global <- t_global["1850/2015", "Monthly_Anomaly_Global"]
plot(temp_global,
  main = "Earth Surface Temperature Anomalies",
  ylab = "Temperatur"
)

We store the data set in a .RData file for further processing.

save(file = "Earth_Surface_Temperature_Global.RData", temp_global)

Citation

The E-Learning project SOGA-R was developed at the Department of Earth Sciences by Kai Hartmann, Joachim Krois and Annette Rudolph. You can reach us via mail by soga[at]zedat.fu-berlin.de.

Creative Commons License
You may use this project freely under the Creative Commons Attribution-ShareAlike 4.0 International License.

Please cite as follow: Hartmann, K., Krois, J., Rudolph, A. (2023): Statistics and Geodata Analysis using R (SOGA-R). Department of Earth Sciences, Freie Universitaet Berlin.