The generalized correlated cross-validation (GCV) score.
Arguments
- y
Response vectorith length
n
or Matrix of set cases with dimension (n
xm
), wheren
is the number of curves andm
are the points observed in each curve.- S
- 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.
Details
$$GCCV = \frac{\sum_{i=1}^n {(y_{i} - \hat{y}_{i, b})}^2}{(1 - \frac{tr(C)}{n})^2}$$
where \(C = 2S\Sigma(\theta) - S\Sigma(\theta)S'\)
and \(\Sigma\) is the \(n \times n\) covariance matrix with \(cor(\epsilon_i, \epsilon_j) = \sigma\).
Here, \(S\) is the smoothing matrix, and there are options for \(C\):
A.- If \(C = 2S\Sigma - S\Sigma S\)
B.- If \(C = S\Sigma\)
C.- If \(C = S\Sigma S'\)
with \(\Sigma\) as the \(n \times n\) covariance matrix and \(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
Carmack, P. S., Spence, J. S., and Schucany, W. R. (2012). Generalised correlated cross-validation. Journal of Nonparametric Statistics, 24(2):269–282.
Oviedo de la Fuente, M., Febrero-Bande, M., Munoz, P., and Dominguez, A. Predicting seasonal influenza transmission using Functional Regression Models with Temporal Dependence.https://arxiv.org/abs/1610.08718
Author
Manuel Febrero-Bande, Manuel Oviedo de la Fuente manuel.oviedo@udc.es
Examples
if (FALSE) { # \dontrun{
data(tecator)
x=tecator$absorp.fdata
x.d2<-fdata.deriv(x,nderiv=)
tt<-x[["argvals"]]
dataf=as.data.frame(tecator$y)
y=tecator$y$Fat
# plot the response
plot(ts(tecator$y$Fat))
nbasis.x=11;nbasis.b=7
basis1=create.bspline.basis(rangeval=range(tt),nbasis=nbasis.x)
basis2=create.bspline.basis(rangeval=range(tt),nbasis=nbasis.b)
basis.x=list("x.d2"=basis1)
basis.b=list("x.d2"=basis2)
ldata=list("df"=dataf,"x.d2"=x.d2)
# No correlation
res.gls=fregre.gls(Fat~x.d2,data=ldata,
basis.x=basis.x,basis.b=basis.b)
# AR1 correlation
res.gls=fregre.gls(Fat~x.d2,data=ldata, correlation=corAR1(),
basis.x=basis.x,basis.b=basis.b)
GCCV.S(y,res.gls$H,"GCCV1",W=res.gls$W)
res.gls$gcv
} # }