1. A method of constructing a probabilistic graphical model of a system from data that includes both normal and anomalous data, the method comprising: learning parameters of a structure for the probabilistic graphical model wherein the structure includes at least one latent variable on which other variables are conditional, and the latent variable having a plurality of components, the structure further including at least one subset variable, the at least one subset variable used to explicitly describe at least one expected mode, wherein the at least one latent variable is conditional on the at least one subset variable; iteratively associating one or more of the plurality of components of the latent variable with normal data; constructing a matrix of the associations; detecting abnormal components of the latent variable based on one of a low association with the normal data or the matrix of associations; and deleting the abnormal components of the latent variable from the probabilistic graphical mode; wherein the step of learning the parameters of the structure is performed by Expectation Maximization; wherein the step of iteratively associating one or more of the plurality of components is performed by calculating the similarity between the one or more components, and wherein the step of learning the parameters of the structure further evidence on the at least one subset variable, and querying the subset variables to retrieve at least one learning datum.