Log-likelihood and component responsibilities over a Gaussian mixture
The responsibilities are returned via the global variable matrix gtmGlobalR. The responsibility gtmGlobalR(k,n) is the probability of a particular component in the Gaussian mixture, k, having generated a particular data point, n. It is calculated from the distances between the data point n and the centres of the mixture components, 1..K, and the inverse variance, beta, common to all components.
llh = gtm_rspg(beta, D, mode)
llh = gtm_rspg(beta, D)
beta
- a scalar value of the inverse variance common to all components of the mixture.
D
- dimensionality of space where the data and the Gaussian mixture lives; necessary to calculate
the correct log-likelihood.
mode
- optional argument used to control the mode of calculation; it can be set to 0, 1 or 2 corresponding
to increasingly elaborate measure taken to reduce the amount of numerical errors; mode = 0 will be fast but less
accurate, mode = 2 will be slow but more accurate; the default mode is 0
llh
- the log-likelihood of data under a the Gaussian mixture.
gtmGlobalR
- an K-by-N responsibility matrix; gtmGlobalR(k,n) is the responsa- bility takened by
mixture component k for data point n.
gtmGlobalDIST
- an K-by-N matrix in which element (k,n) is the Euclidean distance between the centre
of component m and the data point n.
gtmGlobalMinDist, gtmGlobalMaxDist
- vectors containing the minimum and maximum of each column
in DIST, respectively; 1-by-N; required iff m > 0.