GCCV.S | R Documentation |
The generalized correlated cross-validation (GCV) score.
GCCV.S(
y,
S,
criteria = "GCCV1",
W = NULL,
trim = 0,
draw = FALSE,
metric = metric.lp,
...
)
y |
Response vectorith length |
S |
Smoothing matrix, see |
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. |
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
.
Returns GCCV score calculated for input parameters.
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.
Manuel Febrero-Bande, Manuel Oviedo de la Fuente manuel.oviedo@udc.es
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
See Also as optim.np
.
Alternative method
(independent case): GCV.S
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.