DOI: 10.25921/d2sb-w221
title: NOAA/WDS Paleoclimatology - A Bayesian ANOVA Scheme for Calculating Climate Anomalies

description: Climate datasets with both spatial and temporal components are often studied after removing from each time series a temporal mean calculated over a common reference interval, which is generally shorter than theoverall length of the dataset. The use of a short reference interval affects the temporal properties of the variability across the records, by reducing the standard deviation within the reference interval and inflating it elsewhere. For an annually averaged version of the Climate Research Unit's (CRU) temperature anomaly product, the mean standard deviation is 0.67°C within the 1961-90 reference interval, and 0.81°C elsewhere.  The calculation of anomalies can be interpreted in terms of a two-factor analysis of variance model. Within a Bayesian inference framework, any missing values are viewed as additional parameters, and the reference interval is specified as the full length of the dataset. This Bayesian scheme is used to re-express the CRU dataset as anomalies with respect to means calculated over the entire 1850-2009 interval spanned by the dataset. The mean standard deviation is increased to 0.69°C within the original 1961-90 reference interval, and reduced to 0.76°C elsewhere. The choice of reference interval thus has a predictable and demonstrable effect on the second spatial moment time series of the CRU dataset. The spatial mean time series is in this case largely unaffected: the amplitude of spatial mean temperature change is reduced by 0.1°C when using the 1850-2009 reference interval, while the 90% uncertainty interval of (-0.03, 0.23) indicates that the reduction is not statistically significant.
description: Matlab code for two-factor (location and year) analysis-of-variance 
model for the calculation of climate anomalies, in which the reference 
interval is specified as the full length of the dataset. This scheme 
avoids the affects of shorter (e.g. 1961-1990) reference intervals 
on the temporal evolution of the spatial standard deviation of climate 
anomalies. 

Data and code associated with M.P. Tingley Journal of Climate 25:777 

File and folders are as follows:

Demo_code_package
Matlab files to implement the Bayesian model. 
See associated ReadMe.rtf file for details.


Generate_Figures_2_and_3.m
Generate_Figure_4.m
Matlab files to generate Figures 2, 3 and 4 from the paper. 

CRU_Anomalies
CRU_Lats_Lons
CRU_Years
Initial data files. Each entry of CRU_Anomalies corresponds to 
the average of the CRU monthly anomalies (from 1961-199) at a 
particular year and location. The rows are years, given by CRU_Years, 
and the columns locations, given by CRU_Lats_Lons. 


Location_effects_delta_5_50_95
Year_effects_mu_5_50_95

The 5th, 50th, and 95th percentiles of the posterior draws of 
the Location and Year effects. The locations corresponding to 
the rows of Location_effects_delta_5_50_95 are given by the 
rows of CRU_Lats_Lons, while the years corresponding to the 
rows of Year_effects_mu_5_50_95 are given by CRU_Years. 
The three percentiles of the year and location effects 
are used to create Figure 6. 


Scalar_Draws

5000 draws of the scalar parameters. 
Columns are (gamma, sigma^2, sigma^2_mu, sigma^2_delta). 
Histograms of these draws will produce Figure  7.  

Means_Original_Post_5_50_95
StandDevs_Orignal_Post_5_50_95

Left column is the mean (standard deviation) time series of 
the original data (X from the paper). Second through fourth columns 
are the 5th, 50th, and 95th percentiles of the mean (standard deviation) 
time series of the adjusted data (Y from the paper). 
These data sets are used to create Figures 8&9.

Spatial_Mean_1961_1990_5_50_95
Spatial_Mean_1850_2009_5_50_95
Spatial_Mean_1961_1990_Smoothed_5_50_95
Spatial_Mean_1850_2009_Smoothed_5_50_95

The 5th, 50th, and 95th percentiles of the posterior draws 
of the spatial mean time series estimated from BARCAST. 
The years indicate the reference interval used to calculate 
the anomalies, with 1961-1990 being the original CRU data set. 
'Smoothed' indicates that each draw has been temporally smoothed 
prior to calculating percentiles. Note that temporal means of 
the draws were removed prior to forming percentiles (see text). 
These data sets are used to create the panels (a) and (b) of Figure 10. 

Spatial_Mean_Smoothed_difference_5_50_95
The 5th, 50th, and 95th percentiles of the difference between 
the posterior draws of the spatial mean time series estimated 
from BARCAST, using the anomalies from each of the two reference 
intervals. Note that the 90% uncertainty interval for the effect 
of the reference interval on the spatial mean temperature change 
over the last 160 years is calculated from the actual draws of 
the difference, not the percentiles. For each draw of the time 
series of difference, the difference between year 2005 and 1866 
is calculated, and percentiles calculated from the resulting 
distribution. 



Anomalies_1850_2009_5th
Anomalies_1850_2009_50th
Anomalies_1850_2009_95th

The 5th, 50th, and 95th percentiles of the anomalies with respect 
to 1850--2009. These matrices have the same missing data pattern 
as CRU_Anomalies. Please contact the author if your application 
requires the actual posterior draws of the anomaly field, 
rather then the percentiles.