usa48-stdevs

The following is a computation of the standard deviation of USA48 detrended temperature anomolies for 11 yr moving periods from 1895:1905 to 2001:2011.  This was accomplished as follows:

1) Downloaded NCDC's CONUS divisional temperature data.  This consists of 344 climate divisions and covers the period 1895-2011.

2) For each 11 year period and each division the monthly June, July, and August detrended anomolies were calculated.  Note that there was no baseline period.  The detrended anomolies were calculated separately for each specific 11 year period.

3) The standard deviation for each period was then calculated on the combined detrended anomolies for all divisions.

I like this method as it will help minimize variances associated with long term trends and multi-decadal oscillations.  I'm only interested in the "noise" in the signal.

The resulting plot and source code follows:


Source:

# plot stdev of USA48 detrended anomolies for 11yr moving periods 1895:1905 - 2001:2011
#

# read file into dataframe

wdths=c(4,2,4,7,7,7,7,7,7,7,7,7,7,7,7)
cnames=c("div","attr","yr","m01","m02","m03","m04","m05","m06","m07","m08","m09","m10","m11","m12")
colclss=c("character","character","integer","numeric","numeric","numeric","numeric","numeric","numeric",
                                            "numeric","numeric","numeric","numeric","numeric","numeric")

tmpdf=read.fwf("ftp://ftp.ncdc.noaa.gov/pub/data/cirs/drd964x.tmp.txt",widths=wdths,col.names=cnames,colClasses=colclss)

nyrs = 11  # 11 year sample periods
maxyr = max(tmpdf$yr)
minyr = min(tmpdf$yr)
endyr = maxyr - nyrs # last sampled period will exclude maxyr (could contain -99.99's)

divs = unique(tmpdf$div) # climate divisions

# sdvec will store stdev values for each sampled period
sdvec   = NULL

# time values for detrending (0, 1/12, 2/12, 1, 1+1/12, 1+2/12 ... 10+2/12)
t = c(0,1/12,2/12)
t = c(t,t+1,t+2,t+3,t+4,t+5,t+6,t+7,t+8,t+9,t+10)

for (startperiod in minyr:endyr){
    
  endperiod = startperiod + nyrs - 1
  sampyrs = startperiod:endperiod

  # subset temperature dataframe for 11 year period
  yrtmpdf = subset(tmpdf,yr %in% sampyrs)
  
  # dtanomvec will store detrended anomolies for all divisions
  dtanomvec = NULL
  
  for (sampdiv in divs){
  
    # subset 11yr temperature dataframe for the climate division
    divtmpdf = subset(yrtmpdf,div==sampdiv)

    # extract June, July, August values as an array
    divtmp   = cbind(divtmpdf$m06,divtmpdf$m07,divtmpdf$m08)
      
    # calculate monthly means and subtract from monthly values to get anomolies
    divmean = apply(divtmp,2,mean)
    divanom = as.vector(apply(divtmp,1,function(x){x - divmean}))

    # detrend anomolies and paste results for all divisions into dtanomvec
    divlm = lm(divanom ~ t)   
      
    divdtanom = divanom - predict(divlm)
      
    dtanomvec = c(dtanomvec,divdtanom)
    
  }

  # calcuate stdev for sampled period and paste into sdvec
  s     = sd(dtanomvec)
  sdvec = c(sdvec,s)
}

centered_dates = (minyr:endyr) + 5

windows()
# png("usa48-stdev.png", bg="transparent", width=600, height=600)

plot(centered_dates,sdvec,type='l', xlab="Centered Year", ylab="Stdev °C", 
        main=c("USA48 JJA Temperature Stdevs","on 11 yr Detrended Anomolies"))

# dev.off()

Comments