GCCV.S {fda.usc} | R Documentation |
The generalized correlated cross-validation (GCCV) score.
Description
The generalized correlated cross-validation (GCV) score.
Usage
GCCV.S(
y,
S,
criteria = "GCCV1",
W = NULL,
trim = 0,
draw = FALSE,
metric = metric.lp,
...
)
Arguments
y |
Response vectorith length |
S |
|
criteria |
The penalizing function. By default "Rice" criteria. "GCCV1","GCCV2","GCCV3","GCV") 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 |
... |
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}
cor(\epsilon_i,\epsilon_j ) =\sigma
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
Value
Returns GCCV score calculated for input parameters.
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.
Author(s)
Manuel Febrero-Bande, Manuel Oviedo de la Fuente manuel.oviedo@udc.es
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., Pilar Munoz, and Dominguez, A. Predicting seasonal influenza transmission using Functional Regression Models with Temporal Dependence. arXiv:1610.08718. https://arxiv.org/abs/1610.08718
See Also
See Also as optim.np
.
Alternative method
(independent case): GCV.S
Examples
## Not run:
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
## End(Not run)