Gaussian Discriminant Analysis

Gaussian Discriminant Analysis Algorithm

The Gaussian Discriminant Analysis assumes that $y$ and $x|y = 0$ and $x|y = 1$ are such that:

  • $y \sim Bernoulli(\phi)$
  • $x|y = 0 ~ N(\mu_{0}, \Sigma)$
  • $x|y = 1 ~ N(\mu_{1}, \Sigma)$
  1. Fit model $p(x)$ by setting

\[ \mu = \frac{1}{m} \sum^{m}_{i = 1} x^{(i)} \]

\[ \Sigma = \frac{1}{m}\sum^{m}_{i = 1}( x^{(i)} - \mu)( x^{(i)} - \mu)^{T} \]

  1. Given a new example $x$, compute

\[ p(x) = \frac{1}{(2\pi)^{\frac{n}{2}}|\Sigma|^{\frac{1}{2}}}exp(-\frac{1}{2} (x-\mu)^{T} \Sigma^{-1}(x-\mu) ) \]

  1. Flag an anamoly if $p(x) < \epsilon$

Applications

Anamoly detection, Fraud detection, ...

Previous
Next