We downloaded this data set from the Carbon Dioxide Information Analysis Center at Oak Ridge National Laboratory (http://cdiac.ESD.ORNL.GOV/ftp/ndp020). As in Wahba and Luo (1996), we use the averages of winter (December, January and February) temperatures in 1981 from stations (Wahba and Luo (1996) used stations). The data also contains geological locations of these stations in terms of longitude (long.degree) and latitude (lat.degree). We use this data set to illustrate how to fit a spline on the sphere. We first made the following transformations: and . Then and .
> attach(climate) > climate.fit <- ssr(temp~1, rk=sphere(cbind(long,lat)), data=climate) > climate.fit Smoothing spline regression fit by GCV method Call: ssr(formula = temp ~ 1, rk = sphere(cbind(long, lat)), data = climate) GCV estimate(s) of smoothing parameter(s) : 1.293621e-05 Equivalent Degrees of Freedom (DF): 210.993 Estimate of sigma: 2.270291 Number of Observations: 690 > long.grid <- seq(0,2*pi,len=60) > lat.grid <- seq(-pi/2,pi/2,len=60) > p.climate <- predict(climate.fit,expand.grid(long=long.grid,lat=lat.grid))
The contour plot of the predicted values is shown in Figure .