matlab - Multivariate Gaussian distribution formula implementation -


I have a definite problem when implementing multivariate Gaussian distribution for discrepancy detection.

I have given reference to the formula from Andrew NG

  http://www.holehouse.org/mlclass/15_Anomaly_Detection.html  
< P> Below is the problem I have

Suppose I have a data set with two attributes and the number of training numbers is n = 2 and my polygonal probability p. (X; mu; Sigma) which should be [m * 1] matrix because it has to face the problem

I have to face the problem of matrix [M * ​​1] I am unable to use the formula to produce.

I am using Octave as IDE to develop algorithms.

Below is a snapshot of my problem showing

image description here Keeping the multiplication of the red border equation in mind, because the LHS of the red border is just a real number </ p> <p> <img src =

Please help me understand that I am wrong

thanks

< / Div>

I think you have wrong dimensions.

Assume that you have a 2-dimensional ( n = 2 ) data for the m examples. We will call this data in MATLAB a N-by-m can be stored in the form of matrix (columns are data instances, rows represent the feature / dimension) in this case we have:

  • X size data matrix nxm , each example is x = X (:, i) a vector of size nx1 ( Column vector in our conference).
  • mu mean vector ( mu = means (x, 2) ). It is also a column vector of a size whose example is nx1 .
  • Sigma co-operative matrix ( sigma = COV (x. ') ). Its size is nxn (it describes how each dimension varies with each other's dimensions).

Therefore, the part you have highlighted in red, it involves the following: Size:

  = ([nx1] - [nx1]) '* [Nxn] * ([nx1] - [nx1]) = [1xn] * [nxn] * [nx1] = 1x1  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -