Time series are the natural way for accessing information about dynamical systems or processes in a variety of scientific, engineering and financial applications. Due to their complexity, the use of data-based methods is imperative. An example of this method is the symbolic dynamic filtering technique, which involves the determination of Markovian models to express the causal structure of the observed dynamic behavior. We propose a new algorithm for obtaining these models based on variable length Markov chains, machine learning algorithms and graph minimization techniques. To validate the algorithm, we provide modeling examples from simulated and experimental dataset, showing that the obtained model is superior to those generated by other techniques. Finally, we apply the proposed framework for anomalous detection of rotating machines.INDEX TERMS Anomaly detection, clustering, graph minimization, probabilistic finite state automaton, time series analysis, variable length Markov models.