<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: The generalized correlated cross-validation (GCCV) score.</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="R.css" />
</head><body>

<table width="100%" summary="page for GCCV.S"><tr><td>GCCV.S</td><td style="text-align: right;">R Documentation</td></tr></table>

<h2>The generalized correlated cross-validation (GCCV) score.</h2>

<h3>Description</h3>

<p>The generalized correlated cross-validation (GCV) score.
</p>


<h3>Usage</h3>

<pre>
GCCV.S(
  y,
  S,
  criteria = "GCCV1",
  W = NULL,
  trim = 0,
  draw = FALSE,
  metric = metric.lp,
  ...
)
</pre>


<h3>Arguments</h3>

<table summary="R argblock">
<tr valign="top"><td><code>y</code></td>
<td>
<p>Response vectorith length <code>n</code> or Matrix of set cases with
dimension (<code>n</code> x <code>m</code>), where <code>n</code> is the number of curves and
<code>m</code> are the points observed in each curve.</p>
</td></tr>
<tr valign="top"><td><code>S</code></td>
<td>
<p>Smoothing matrix, see <code>S.NW</code>, <code>S.LLR</code> or
<i>S.KNN</i>.</p>
</td></tr>
<tr valign="top"><td><code>criteria</code></td>
<td>
<p>The penalizing function. By default <em>&quot;Rice&quot;</em> criteria.
&quot;GCCV1&quot;,&quot;GCCV2&quot;,&quot;GCCV3&quot;,&quot;GCV&quot;) Possible values are <em>&quot;GCCV1&quot;</em>,
<em>&quot;GCCV2&quot;</em>, <em>&quot;GCCV3&quot;</em>, <em>&quot;GCV&quot;</em>.</p>
</td></tr>
<tr valign="top"><td><code>W</code></td>
<td>
<p>Matrix of weights.</p>
</td></tr>
<tr valign="top"><td><code>trim</code></td>
<td>
<p>The alpha of the trimming.</p>
</td></tr>
<tr valign="top"><td><code>draw</code></td>
<td>
<p>=TRUE, draw the curves, the sample median and trimmed mean.</p>
</td></tr>
<tr valign="top"><td><code>metric</code></td>
<td>
<p>Metric function, by default <code>metric.lp</code>.</p>
</td></tr>
<tr valign="top"><td><code>...</code></td>
<td>
<p>Further arguments passed to or from other methods.</p>
</td></tr>
</table>


<h3>Details</h3>

<p style="text-align: center;"><i>&sum;(y-y.fit)^2 / (1-tr(C)/n)^2</i></p>
<p style="text-align: center;"><i>&sum;(y-y.fit)^2 /
(1-tr(C)/n)^2</i></p>
 

<p><i>cor(&epsilon;_i,&epsilon;_j ) =&sigma;</i><br />
</p>
<p>where <i>S</i> is the smoothing matrix <i>S</i> and:<br /> A.-If <i>C=2S&Sigma;
- S&Sigma; S</i> <br /> B.-If <i>C=S&Sigma;</i> <br /> C.-If <i>C=S&Sigma; S'</i> <br /> with
<i>&Sigma;</i> is the n x n covariance matrix with
<i>cor(&epsilon;_i,&epsilon;_j ) =&sigma;</i>
</p>


<h3>Value</h3>

<p>Returns GCCV score calculated for input parameters.
</p>


<h3>Note</h3>

<p>Provided that <i>C = I</i> and the smoother matrix S is symmetric and
idempotent, as is the case for many linear fitting techniques, the trace
term reduces to <i>n - tr[S]</i>, which is proportional to the familiar
denominator in GCV.
</p>


<h3>Author(s)</h3>

<p>Manuel Febrero-Bande, Manuel Oviedo de la Fuente
<a href="mailto:manuel.oviedo@udc.es">manuel.oviedo@udc.es</a>
</p>


<h3>References</h3>

<p>Carmack, P. S., Spence, J. S., and Schucany, W. R. (2012).
Generalised correlated cross-validation. Journal of Nonparametric
Statistics, 24(2):269&ndash;282.
</p>
<p>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.
<a href="https://arxiv.org/abs/1610.08718">https://arxiv.org/abs/1610.08718</a>
</p>


<h3>See Also</h3>

<p>See Also as <code>optim.np</code>. <br /> Alternative method
(independent case): <code>GCV.S</code>
</p>


<h3>Examples</h3>

<pre>
## Not run: 
data(tecator)
x=tecator$absorp.fdata
x.d2&lt;-fdata.deriv(x,nderiv=)
tt&lt;-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)
</pre>


</body></html>
