Skip to contents

Compute the generalized correlated cross-validation (GCV) score.

Usage

GCV.S(
  y,
  S,
  criteria = "GCV",
  W = NULL,
  trim = 0,
  draw = FALSE,
  metric = metric.lp,
  ...
)

Arguments

y

Matrix of set cases with dimension (n x m), where n is the number of curves and m are the points observed in each curve.

S

Smoothing matrix, see S.NW, S.LLR or

criteria

The penalizing function. By default "Rice" criteria. Possible values are "GCCV1", "GCCV2", "GCCV3", "GCV".

W

Matrix of weights.

trim

The alpha of the trimming.

draw

=TRUE, draw the curves, the sample median and trimmed mean.

metric

Metric function, by default metric.lp.

...

Further arguments passed to or from other methods.

Value

Returns GCV score calculated for input parameters.

Details

A.-If trim=0:
$$GCCV=\frac{\sum_{i=1}^n {y_{i}-\hat{y}_{i,b}}^2}{1-\frac{tr(C)}{n}^2}$$ where \(S\) is the smoothing matrix \(S\) and:
A.-If \(C=2S\Sigma - S\Sigma S\)
B.-If \(C=S\Sigma\)
C.-If \(C=S\Sigma S'\)
with \(\Sigma\) is the n x n covariance matrix with \(cor(\epsilon_i,\epsilon_j ) =\sigma\) Note: Provided that \(C = I\) and the smoother matrix S is symmetric and idempotent, as is the case for many linear fitting techniques, the trace term reduces to \(n - tr[S]\), which is proportional to the familiar denominator in GCV.

References

Wasserman, L. All of Nonparametric Statistics. Springer Texts in Statistics, 2006. Hardle, W. Applied Nonparametric Regression. Cambridge University Press, 1994. Febrero-Bande, M., Oviedo de la Fuente, M. (2012). Statistical Computing in Functional Data Analysis: The R Package fda.usc. Journal of Statistical Software, 51(4), 1-28. https://www.jstatsoft.org/v51/i04/

See also

See Also as optim.np
Alternative method: CV.S

Author

Manuel Febrero-Bande, Manuel Oviedo de la Fuente manuel.oviedo@udc.es

Examples

if (FALSE) { # \dontrun{
data(phoneme)
mlearn<-phoneme$learn
tt<-1:ncol(mlearn)
S1 <- S.NW(tt,2.5)
S2 <- S.LLR(tt,2.5)
gcv1 <- GCV.S(mlearn, S1)
gcv2 <- GCV.S(mlearn, S2)
gcv3 <- GCV.S(mlearn, S1,criteria="AIC")
gcv4 <- GCV.S(mlearn, S2,criteria="AIC")
gcv1; gcv2; gcv3; gcv4
} # }