# Constructing a Bayesian Classifier in R

Does anybody know the way to construct a Bayesian classifier in R for two bi-variate gaussian distributions of which the means and variances are known? The two classes are equi-probable and the variables are independent from each other.

Any help is deeply appreciated.

-
We already answered that in your other post stats.stackexchange.com/questions/24772/… . You just have to check inequality (*). What is the deal of doing that? –  Zen Mar 19 '12 at 19:44
Hi, thanks for the comment. What you mean is, that I need to do the entire set of steps in deriving the Bayesian classifier as you showed in the above post in R too? I am interested in knowing whether there is a method specific to R in doing that here. –  picmate Mar 20 '12 at 21:59
When you have known means / variances, this classifier amounts to just finding the likelihood of your sample under the two models and choosing the one that's greater. I don't use R, but it looks like dnorm2d or dmvnorm will find likelihoods for you; dnorm2d is bivariate-specific but you have to subtract the mean off and maybe divide by sigmas yourself, while dmvnorm will do those for you but you have to make the 2x2 covariance matrix yourself.