[R] Getting the Bootstrap Error Rate of QDA

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu May 22 08:29:26 CEST 2003


You need to investigate the validity of bootstrapping here.

Remember that to use QDA you need as any observations in each group as 
dimensions, and futhermore those observations need to like ones from a 
non-degenerate normal distribution.

Unless this is a balanced bootstrap you may end up with too few in each 
group, and even then the repeating of observations makes this nothing like 
the assumed distribution theory and you may well have enough observations 
but not enough distinct ones.


On Thu, 22 May 2003, Ko-Kang Kevin Wang wrote:

> Hi,
> 
> What does this mean when I have something like:
> >  qda.boot <- boot(train, qda.bootstrap, R = 500)
>  Error in qda.default(structure(data.matrix(x), class = "matrix"), ...) : 
> 	Rank deficiency in group M
> with my qda.bootstrap() looks something like:
> > qda.bootstrap <- function(data, index) {
> +   boot.qda <- qda(x = data[index, 2:9], group = data[index, 1])
> +   qda.pred <- predict(boot.qda)
> +   boot.resub <- sum(qda.pred$class != data[, 1]) / nrow(data)
> +   data.pred <- predict(boot.qda, data[, 2:9])
> +   data.resub <- sum(data.pred$class != data[,1]) / nrow(data)
> +   abs(data.resub - boot.resub)
> + }
> 
> If I run qda.boot <- boot(train, qda.bootstrap, R = 500) a couple of 
> times, it sometimes work but other times just give me the error message 
> above.  Is there a way to solve this?

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list