dev.S
The deviance score
Returns the deviance of a fitted model object by GCV score.
- Keywords
- utilities
Usage
dev.S(
y,
S,
obs,
family = gaussian(),
off,
offdf,
criteria = "GCV",
W = diag(1, ncol = ncol(S), nrow = nrow(S)),
trim = 0,
draw = FALSE,
...
)
Arguments
- y
Matrix of set cases with dimension (
n
xm
), wheren
is the number of curves andm
are the points observed in each curve.- S
Smoothing matrix.
- obs
observed response.
- family
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
family
for details of family functions.)- off
off
- offdf
off, degrees of freedom
- criteria
The penalizing function. By default "Rice" criteria. Possible values are "GCV", "AIC", "FPE", "Shibata", "Rice".
- W
Matrix of weights.
- trim
The alpha of the trimming.
- draw
=TRUE, draw the curves, the sample median and trimmed mean.
- …
Further arguments passed to or from other methods.
Details
Up to a constant, minus twice the maximized log-likelihood. Where sensible, the constant is chosen so that a saturated model has deviance zero.
$$GCV(h)=p(h) \Xi(n^{-1}h^{-1})$$
Where $$p(h)=\frac{1}{n} \sum_{i=1}^{n}{\Big(y_i-r_{i}(x_i)\Big)^{2}w(x_i)}$$ and penalty function $$\Xi()$$ can be selected from the following criteria:
Generalized Cross-validation (GCV):
$$\Xi_{GCV}(n^{-1}h^{-1})=(1-n^{-1}S_{ii})^{-2}$$ Akaike's Information Criterion (AIC):
$$\Xi_{AIC}(n^{-1}h^{-1})=exp(2n^{-1}S_{ii})$$ Finite Prediction Error (FPE)
$$\Xi_{FPE}(n^{-1}h^{-1})=\frac{(1+n^{-1}S_{ii})}{(1-n^{-1}S_{ii})}$$
Shibata's model selector (Shibata):
$$\Xi_{Shibata}(n^{-1}h^{-1})=(1+2n^{-1}S_{ii})$$ Rice's bandwidth selector (Rice): $$\Xi_{Rice}(n^{-1}h^{-1})=(1-2n^{-1}S_{ii})^{-1}$$
Value
Returns GCV score calculated for input parameters.
References
Wasserman, L. All of Nonparametric Statistics. Springer Texts in Statistics, 2006.
Hardle, W. Applied Nonparametric Regression. Cambridge University Press, 1994.
Febrero-Bande, M., Oviedo de la Fuente, M. (2012). Statistical Computing in Functional Data Analysis: The R Package fda.usc. Journal of Statistical Software, 51(4), 1-28. http://www.jstatsoft.org/v51/i04/
See Also
Examples
# NOT RUN {
data(phoneme)
mlearn<-phoneme$learn
np<-ncol(mlearn)
tt<-mlearn[["argvals"]]
S1 <- S.NW(tt,2.5)
gcv1 <- dev.S(mlearn$data[1,],obs=(sample(150)),
S1,off=rep(1,150),offdf=3)
gcv2 <- dev.S(mlearn$data[1,],obs=sort(sample(150)),
S1,off=rep(1,150),offdf=3)
# }