Learn R Programming

sspline (version 0.1-3)

smooth.sspline: Smoothing Spline on the Sphere

Description

It fits a smoothing splines on the sphere with the smoothing parameter chosen by the generalized cross validation (GCV) criteria or given by the user.

Usage

smooth.sspline(lon, lat, y, m = 2, smth = 0, lambda = 0)

Arguments

lon
numeric vector, the longitudes
lat
numeric vector, the latitudes
y
numeric vector, the observations at (lon, lat)
m
integer, order of smoothing, takes value from 1 to 10. Default to 2
smth
method for choosing the smoothing parameter: 0, gcv method; 1, user specified. Default to 0
lambda
used only when smth = 1.

Value

  • A smooth.sspline object with the components
  • lonthe original longitude
  • latthe original latitude
  • obsthe original observation
  • lambdathe lambda that minimizes the gcv score
  • gcvthe corresponding gcv value at lambda
  • varhatthe estimated variance
  • cthe coefficient vector c for the estimated function
  • dthe coefficient d for the estimated function
  • yhatthe estimated (smoothed) observation
  • callthe call to smooth.sspline

Details

It calls Fortran subroutine with the .Fortran interface.

References

Grace Wahba (1981), Spline Interpolation and Smoothing on the Sphere, SIAM J. SCI. STAT. COMPUT.

Examples

Run this code
data(WTdiff)

subdat <- WTdiff[sample(nrow(WTdiff), 200), 2:4]
attach(subdat)

smooth.sspline(lon, lat, avgd)

detach(subdat)

Run the code above in your browser using DataLab