<!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 deviance 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 dev.S"><tr><td>dev.S</td><td style="text-align: right;">R Documentation</td></tr></table>

<h2>The deviance score</h2>

<h3>Description</h3>

<p>Returns the deviance of a fitted model object by GCV score.
</p>


<h3>Usage</h3>

<pre>
dev.S(
  y,
  S,
  obs,
  family = gaussian(),
  off,
  offdf,
  criteria = "GCV",
  W = diag(1, ncol = ncol(S), nrow = nrow(S)),
  trim = 0,
  draw = FALSE,
  ...
)
</pre>


<h3>Arguments</h3>

<table summary="R argblock">
<tr valign="top"><td><code>y</code></td>
<td>
<p>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.</p>
</td></tr>
<tr valign="top"><td><code>obs</code></td>
<td>
<p>observed response.</p>
</td></tr>
<tr valign="top"><td><code>family</code></td>
<td>
<p>a description of the error distribution and link function to
be used in the model. This can be a character string naming a family
function, a family function or the result of a call to a family function.
(See <code>family</code> for details of family functions.)</p>
</td></tr>
<tr valign="top"><td><code>off</code></td>
<td>
<p>off</p>
</td></tr>
<tr valign="top"><td><code>offdf</code></td>
<td>
<p>off, degrees of freedom</p>
</td></tr>
<tr valign="top"><td><code>criteria</code></td>
<td>
<p>The penalizing function. By default <em>&quot;Rice&quot;</em> criteria.
Possible values are <em>&quot;GCV&quot;</em>, <em>&quot;AIC&quot;</em>, <em>&quot;FPE&quot;</em>,
<em>&quot;Shibata&quot;</em>, <em>&quot;Rice&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>...</code></td>
<td>
<p>Further arguments passed to or from other methods.</p>
</td></tr>
</table>


<h3>Details</h3>

<p>Up to a constant, minus twice the maximized log-likelihood. Where sensible,
the constant is chosen so that a saturated model has deviance zero.
</p>
<p style="text-align: center;"><i></i></p>
 
<p>Where <br /> </p>
<p style="text-align: center;"><i></i></p>
 <p><br /> and penalty
function </p>
<p style="text-align: center;"><i></i></p>
<p> can be selected from the following criteria: <br />
</p>
<p>Generalized Cross-validation (GCV):
</p>
<p style="text-align: center;"><i></i></p>
 <p><br /> Akaike's
Information Criterion (AIC): 
</p>
<p style="text-align: center;"><i></i></p>
 
<p>Finite Prediction Error (FPE) 
</p>
<p style="text-align: center;"><i></i></p>

<p>Shibata's model selector (Shibata): 
</p>
<p style="text-align: center;"><i></i></p>

<p>Rice's bandwidth selector (Rice):
</p>
<p style="text-align: center;"><i></i></p>



<h3>Value</h3>

<p>Returns GCV score calculated for input parameters.
</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>Wasserman, L. <em>All of Nonparametric Statistics</em>. Springer
Texts in Statistics, 2006.
</p>
<p>Hardle, W. <em>Applied Nonparametric Regression</em>. Cambridge University
Press, 1994.
</p>
<p>Febrero-Bande, M., Oviedo de la Fuente, M. (2012).  <em>Statistical
Computing in Functional Data Analysis: The R Package fda.usc.</em> Journal of
Statistical Software, 51(4), 1-28. <a href="https://www.jstatsoft.org/v51/i04/">https://www.jstatsoft.org/v51/i04/</a>
</p>


<h3>See Also</h3>

<p>See Also as <code>GCV.S</code>. <br /> Alternative method:
<code>CV.S</code>
</p>


<h3>Examples</h3>

<pre>
data(phoneme)
mlearn&lt;-phoneme$learn
np&lt;-ncol(mlearn)
tt&lt;-mlearn[["argvals"]]
S1 &lt;- S.NW(tt,2.5)
gcv1 &lt;- dev.S(mlearn$data[1,],obs=(sample(150)), 
S1,off=rep(1,150),offdf=3)
gcv2 &lt;- dev.S(mlearn$data[1,],obs=sort(sample(150)), 
S1,off=rep(1,150),offdf=3)

</pre>


</body></html>
