discrim
Object
discrim
object estimating a discriminant function.
crossvalidate.discrim(object, doubt=0, digits=.Options$digits, recompute=F, trace=T, subset)
discrim
object constructed by the
discrim
function containing the estimated discriminant function.
doubt
< (g-1)/g, where g is the number of groups,
defining the minimum difference the maximum posterior probability of group
membership must exceed all others before assigning the observation to that group. If there does
not exist a posterior probability of group membership for an observation that exceeds
doubt
+ 1/g, the observation is assigned to an "unknown" group.
recompute
is F, where an error is issued to warn the user of this condition.
group
factor column followed by the posterior probability of group membership
for each observation in the training data used to fit the discriminant function.
Performs cross-validation of the discriminant function contained in
object
.
Formulas exist for evaluating the posterior probability of group membership for this leave-one-out
method of error rate evaluation without recomputing the discriminant function
for the
Classical
homoscedastic and heteroscedastic models
(McLachlan, 1992, p.341-344) and (Ripley, 1996, p.100) and can be evaluated in a
timely manner.
The S code that evaluates these functions is based on Venables and Ripley's (1997)
lda
and
qda
functions with
CV
= T.
The spherical and group spherical covariance structure models can be computed with
out refitting the discriminant function also. Discriminant functions using the remaining covariance
structures described in the help documentation for the
discrim
function must recompute the function
in order to evaluate the leave-one-out error rate and can take considerable amount of time.
McLachlan, G. J. (1992).
Discriminant Analysis and Statistical Pattern Recognition,
John Wiley & Sons.
Ripley, B.D. (1996).
Pattern Recognition and Neural Networks,
Cambridge University Press.
Venables, W.N. and Ripley, B.D. (1997).
Modern Applied Statistics with S-PLUS, Second Ed.,
Springer.
# The Iris data iris.quad <- discrim(Species ~ Sepal.L. + Sepal.W. + Petal.L. + Petal.W., data=iris.mm, family=Classical("heter")) cv <- crossvalidate(iris.quad) cv[sort(sample(seq(150),15)),] table(Iris.mm$Sp,cv$group)