[R] Fisher LDA and prior=c(...) argument

Edoardo M Airoldi eairoldi at stat.cmu.edu
Mon May 19 00:43:38 CEST 2003

 I am using LDA and QDA function of MASS library.  I understand Fisher LDA 
is a method non-probabilistic in nature, so I wonder what happens when I 
try to predict my test set examples as in:

> fit <- lda(labels~., data=train.table, prior=c(.5,.5))
> pred <- predict(fit, data=test.table, prior=c(.5,.5))

 Specifically I ask this because in my problem there are 700 examples 
class A, and 50 in class B, and I'd be glad to use a way to weight the 
contribution of the examples in different classes.
 My guess is that the CODE above estimates the likelihood of of the Fisher 
scores for (example | class) and then implements the Bayes rule to return 
the maximum a-posteriori class.

 Is that correct?  Any pointer towards that direction is appreciated.  
Please cc to edo at stat.cmu.edu your reply.

Edoardo M. Airoldi
BH 232L  (412) 268.7829
PC Lab   (412) 268.8719

More information about the R-help mailing list