gcv.lambda: Calculation of Generalized Cross-validation

Description Usage Arguments Value See Also Examples

Description

This function calculates generalized cross-validation for ridge regression.

Usage

1
gcv.lambda(obs, latlon, netlab, eta, approx=FALSE, lambda) 

Arguments

obs

observations

latlon

grid points of observation sites in degree

netlab

vector of labels representing sub-networks

eta

bandwidth parameters for Poisson kernel

approx

if TRUE, approximation is used.

lambda

smoothing parameter for penalized least squares method

Value

gcv

generalized cross-validation for ridge regression.

See Also

ridge.diacomp, ridge.comp.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
### Observations of year 1967
#data(temperature)
#names(temperature)

# Temperatures on 939 weather stations of year 1967    
#temp67 <- temperature$obs[temperature$year == 1967] 
# Locations of 939 weather stations    
#latlon <- temperature$latlon[temperature$year == 1967, ]

### Network design by BUD
#data(netlab)

### Bandwidth for Poisson kernel
#eta <- c(0.961, 0.923, 0.852, 0.723, 0.506)

### Select smoothing parameter lambda by generalized cross-validation
#lam <- seq(0.1, 0.9, ,9)
#gcv <- NULL
#for(i in 1:length(lam))
#    gcv <- c(gcv, gcv.lambda(obs=temp67, latlon=latlon, 
#        netlab=netlab, eta=eta, lambda=lam[i])$gcv)
#lam[gcv == min(gcv)]

SpherWave documentation built on April 14, 2017, 1:28 p.m.