Data and code associated with,

Martin P. Tingley, "A Bayesian ANOVA scheme for calculating climate anomalies, with applications to the instrumental temperature record."

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.