Readme file

SERIES B
Statistical Methodology

Inference of trends in time series,
W. B. Wu and Z. Zhao
J. R. Statist. Soc. B, Volume 69, (2007), 391–410

The data file ‘Nile.txt” consists of measurements of the annual flow of the river Nile at Aswan from 1871 to 1970. The data set is studied in Section 7.1. It can be downloaded from http://www.ssfpack.com/dkbook/dkdata/nile.dat To test the existence of structural breaks, we use the function pval(.) in our programs for trend analysis ‘trend.S.txt’:

nile=read.table("Nile.txt");
source("trend.S.txt")
pval(t(nile)/162)
   [,1]   [,2]
[1,]   0 1.568287

The p-value is around 0 and the test statistic is 1.57.

The data file ‘gtemp.txt’ contains global monthly temperature anomalies from 1856 to 2000; see Jones, P. D., Parker, D. E., Osborn, T. J. and Briffa, K. R. (2006) Global and hemispheric temperature anomalies--land and marine instrumental records. In Trends: A Compendium of Data on Global Change. Carbon Dioxide Information Analysis Center, Oak Ridge National Laboratory, U.S. Department of Energy, Oak Ridge, Tenn., U.S.A.

To construct the monthly temperature series, use the commands:

gl=read.table("gtemp.txt", h=T);
attach(gl);
month=rep(0, dim(gl)[1]*12)
for (i in 1: dim(gl)[1]) month[(1+(i-1)*12):(i*12)] = t(gl[i,2:13])
n=length(month); x=1:n;

Load the package KernSmooth (Functions for kernel smoothing for Wand & Jones (1995) and our programs for trend analysis ‘trend.S.txt’:
library(KernSmooth); source("trend.S.txt");

We use the bandwidth b=69.4 and obtain the estimated sigma=0.44.

b=69.4; sigma=0.44;

Following the procedure outlined in Section 4.1, we can construct SCB as

J=1000; M=cutoffscbllr(month, b, J); M=sort(M);
plot(month, xlab="month", ylab="Temperature", type='l')
fit1 = locpoly(x, month, bandwidth=b, gridsize=n)
fit2 = locpoly(x, month, bandwidth=b*2^.5, gridsize=n)
yfit= 2*fit1$y-fit2$y; ##Bias corrected local linear fit
y95=yfit+M[.95*J]*sigma ##Upper band of the .95 SCB
y05=yfit-M[.95*J]*sigma ##Lower band of the .95 SCB

Since this procedure involves relatively extensive simulations, you need to be patient. On a typical Pentium IV machine, it takes about 2 minutes. We also apply other regression techniques:

yq=lm(month~x+I(x^2))$fit    ## The quadratic curve fit
yl=lm(month~x)$fit    ## The linear fit
yi=isoreg(month)$yf     ## The isotonic regression fit
matplot(cbind(yfit, y95, y05, yi, yl,yq), typ='l')

Wei Biao Wu
Department of Statistics
University of Chicago
5734 South University Avenue
Chicago
IL 60637
USA

E-mail: wbwu@galton.uchicago.edu

Journals

SERIES A
Statistics in Society

SERIES B
Statistical Methodology

SERIES C
Applied Statistics

SERIES D
The Statistician