0

Basically I do not understand the mathematics behind the follow in Andrew machine learning on anomalous detection.

  1. X = bsxfun(@minus, X, mu(:)');

  2. p = (2 * pi) ^ (- k / 2) * det(Sigma2) ^ (-0.5) * ... exp(-0.5 * sum(bsxfun(@times, X * pinv(Sigma2), X), 2));

The P signifies the multivariate Gaussian distribution

1 Answers1

1

The first step calculates the difference between a variable and its mean.

The second step plugs this result into the multivariate gaussian probability density function to calculate the probability of that observation.

To detect anomalies, the Gaussian model is constructed from a training set and you define a threshold probability, then when you calculate the probability of a new observation you compare it to the threshold probability to determine whether it is or not an anomaly.

A detailed explanation of the mathematics involved in the PDF can be found here..