BAYESDF

Computes decision boundary of Bayesian classifier.



 Synopsis:
  quad_model = bayesdf(model)

 Description:
  This function computes parameters of decision boundary
  of the Bayesian classifier with the following assumptions:
   - 1/0 loss function (risk = expectation of misclassification).
   - Binary classification.
   - Class conditional probabilities are multivariate Gaussians.

  In this case the Bayesian classifier has the quadratic 
  discriminant function
              f(x) = x'*A*x + B'*x + C,
  
  where the classification strategy is
  q(x) = 1  if f(x) >= 0,
       = 2  if f(x) < 0.

 Input:
  model [struct] Two multi-variate Gaussians:
   .Mean [dim x 2] Mean values.
   .Cov [dim x dim x 2] Covariances.
   .Prior [1x2] A priory probabilities.

 Output:
  quad_model.A [dim x dim] Quadratic term.
  quad_model.B [dim x 1] Linear term.
  quad_model.C [1x1] Bias.

 Example:
  trn = load('riply_trn');
  tst = load('riply_trn');
  gauss_model = mlcgmm(trn);
  quad_model = bayesdf(gauss_model);
  ypred = quadclass(tst.X,quad_model);
  cerror(ypred,tst.y)
  figure; ppatterns(trn); pboundary(quad_model); 

 See also
  BAYESCLSQUADCLASS


Source: bayesdf.m

About: Statistical Pattern Recognition Toolbox
(C) 1999-2003, Written by Vojtech Franc and Vaclav Hlavac
Czech Technical University Prague
Faculty of Electrical Engineering
Center for Machine Perception

Modifications:
18-oct-2005, VF, dealing with Cov given as vector repared
01-may-2004, VF
19-sep-2003, VF
24. 6.00 V. Hlavac, comments into English.