Bayesian Decision Theory – Discriminant Functions and Normal Density (Part 3)

Introduction

Welcome back to our multi-part series on Bayesian decision theory! In the previous two articles, we laid the foundation by introducing the core concepts of Bayesian decision making, including prior probabilities, class-conditional densities, posterior probabilities, and Bayes optimal classifiers. We also examined the decision-making process for different scenarios involving various states of nature and actions.

In this article, we will dive deeper into the inner workings of Bayesian classifiers by exploring discriminant functions and their relationship to decision surfaces. We will pay special attention to the two-category case and investigate how the normal (Gaussian) density comes into play. Finally, we will implement an interactive web-based discriminant function calculator to gain hands-on experience with these concepts. Let‘s get started!

Classifiers, Discriminant Functions, and Decision Surfaces

At its core, a Bayesian classifier aims to assign input feature vectors to different classes based on a decision rule that minimizes the overall risk or maximizes the posterior probability. This classification process can be represented in various ways, but one of the most common approaches is to use a set of discriminant functions gi(x), where i = 1, …, c for a c-class problem.

The classifier computes the value of each discriminant function gi(x) for an input vector x and assigns x to class ωi if gi(x) > gj(x) for all j ≠ i. In other words, the classifier selects the class corresponding to the discriminant function with the highest value.

The choice of discriminant functions is not unique, as they can be scaled or shifted without affecting the decision boundary. Common choices include:

  • gi(x) = -R(αi | x), the negative conditional risk
  • gi(x) = P(ωi | x), the posterior probability
  • gi(x) = ln p(x | ωi) + ln P(ωi), the log-likelihood plus the log prior

The decision boundary between classes in feature space is determined by the points where the discriminant functions are equal, i.e., gi(x) = gj(x). These boundaries partition the feature space into c decision regions R1, R2, …, Rc, where the classifier assigns input vectors in region Ri to class ωi.

The Two-Category Case

For a two-class problem, also known as a dichotomizer, we can simplify the decision-making process by defining a single discriminant function:

g(x) ≡ g1(x) – g2(x)

The classifier then assigns x to class ω1 if g(x) > 0 and to class ω2 otherwise. This simplification allows us to focus on a single function and its sign rather than comparing multiple functions.

Some common discriminant functions for the two-category case include:

  • g(x) = P(ω1 | x) – P(ω2 | x), the difference of posteriors
  • g(x) = ln (p(x | ω1) / p(x | ω2)) + ln (P(ω1) / P(ω2)), the log-likelihood ratio plus the log prior ratio

The Normal (Gaussian) Density

In many real-world applications, the class-conditional densities p(x | ωi) are assumed to follow a normal or Gaussian distribution. The normal density is an attractive choice due to its mathematical properties and the central limit theorem, which states that the sum of a large number of independent random variables tends towards a Gaussian distribution.

For a univariate normal density, the probability density function (PDF) is given by:

p(x) = (1 / (σ√(2π))) exp(-(x – μ)² / (2σ²))

where μ is the mean, and σ² is the variance. The normal density is fully characterized by these two parameters.

In the multivariate case, the normal density for a d-dimensional vector x is given by:

p(x) = (1 / ((2π)^(d/2) |Σ|^(1/2))) exp(-1/2 (x – μ)^T Σ^(-1) (x – μ))

where μ is the d-dimensional mean vector, Σ is the d × d covariance matrix, |Σ| is the determinant of Σ, and Σ^(-1) is the inverse of Σ.

The covariance matrix Σ plays a crucial role in the multivariate normal density. It is symmetric and positive semidefinite, and its diagonal elements σii represent the variances of the individual components, while the off-diagonal elements σij represent the covariances between components. If σij = 0, then the corresponding components xi and xj are statistically independent.

Discriminant Functions for Normal Densities

When the class-conditional densities are normally distributed, we can derive explicit expressions for the discriminant functions. Let‘s consider a two-category case with classes ω1 and ω2, where the class-conditional densities are:

p(x | ω1) = N(μ1, Σ1)
p(x | ω2) = N(μ2, Σ2)

Here, N(μ, Σ) denotes a normal density with mean μ and covariance Σ.

The log-likelihood ratio discriminant function for this case is:

g(x) = ln (p(x | ω1) / p(x | ω2))
= -1/2 (x – μ1)^T Σ1^(-1) (x – μ1) + 1/2 (x – μ2)^T Σ2^(-1) (x – μ2) + ln (|Σ2| / |Σ1|)

If the covariance matrices are equal (Σ1 = Σ2 = Σ), the discriminant function simplifies to:

g(x) = (μ1 – μ2)^T Σ^(-1) x – 1/2 (μ1^T Σ^(-1) μ1 – μ2^T Σ^(-1) μ2)

This is a linear function of x, and the decision boundary is a hyperplane.

If the covariance matrices are diagonal (Σi = diag(σi1², …, σid²)), the discriminant function becomes:

g(x) = Σj=1^d ((xj – μ1j)² / σ1j² – (xj – μ2j)² / σ2j²) + Σj=1^d ln (σ2j / σ1j)

This corresponds to a quadratic decision boundary.

Discriminant Function Calculator

To help visualize and experiment with discriminant functions, we have developed an interactive web-based discriminant function calculator. The calculator allows you to input the parameters of two normally distributed classes (means, variances, and prior probabilities) and displays the resulting discriminant function and decision boundary.

You can access the discriminant function calculator at the following link: [Insert link to your web-based calculator]

The calculator provides a user-friendly interface to explore different scenarios and gain intuition about the behavior of discriminant functions for normally distributed classes.

Real-World Applications

Discriminant functions and Bayesian decision theory find applications in various domains, including:

  1. Spam email filtering: Classify incoming emails as spam or non-spam based on features like word frequencies, sender information, and email structure.

  2. Medical diagnosis: Determine the likelihood of a patient having a specific disease based on symptoms, test results, and risk factors.

  3. Credit scoring: Assess the creditworthiness of loan applicants using features such as income, credit history, and employment status.

  4. Fraud detection: Identify fraudulent transactions or insurance claims by analyzing patterns and anomalies in data.

  5. Speech recognition: Classify spoken words or phonemes based on acoustic features extracted from audio signals.

In each of these applications, the goal is to make optimal decisions based on available information and minimize the overall risk or cost associated with misclassifications.

Conclusion

In this article, we explored the concepts of discriminant functions, decision surfaces, and the normal density in the context of Bayesian decision theory. We focused on the two-category case and derived discriminant functions for normally distributed classes with different covariance structures.

By understanding these concepts and utilizing tools like the discriminant function calculator, you can gain a deeper understanding of how Bayesian classifiers work and how to apply them to real-world problems. In the next article, we will delve into more advanced topics, such as parameter estimation, model selection, and the connections between Bayesian decision theory and other machine learning approaches.

Stay tuned for more insights and practical examples in the exciting world of Bayesian decision theory!

References

  1. Duda, R. O., Hart, P. E., & Stork, D. G. (2012). Pattern classification. John Wiley & Sons.
  2. Bishop, C. M. (2006). Pattern recognition and machine learning. Springer.
  3. Murphy, K. P. (2012). Machine learning: a probabilistic perspective. MIT Press.

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

Similar Posts