I have been learning about the EM algorithm by using the material of Andrew Ng from Stanford, the link is here: http://cs229.stanford.edu/notes/cs229-notes7b.pdf And I have been trying to understand the implementation of the EM by using a Python library, and specifically to work with the Old Faithful data set. The link is the following: https://mixem.readthedocs.io/en/latest/examples/old_faithful.html This data set has approximately 272 observations with two variables that are the eruption time and the waiting time; which has information of the timing between eruptions. I have a couple of questions about the following lines of code:
weights, distributions, ll = mixem.em(np.array(data), [
mixem.distribution.MultivariateNormalDistribution(np.array((2, 50)), np.identity(2)),
mixem.distribution.MultivariateNormalDistribution(np.array((4, 80)), np.identity(2)),
])
That is related to the following part:
and the questions that I have are:
- Why do I have to created two arrays for mu and why to consider those dimensions? I suppose the first one (2,50) the first 2 refers to the number of variables (eruption and waiting), but why to put 50 as a second dimension. Also, why do I need the array of (4,80) and the two identity arrays with dimension 2?