A hidden Markov model (HMM) is a simple Dynamic Bayesian Network (DBN) with hidden variables, which has been classically applied to speech recognition techniques. It is also popular to explain the economic models with HMMs, which are called regime switching models. That is useful for representing state changes in stock markets by the discrete hidden variables of the HMM. In this study, we applied the HMM to stock markets including Korean stock market, and tested whether it is a good model compared to the geometric Brownian motion (GBM), which has been popularly used as a market model. We analysed the characteristics of markets by applying HMMs. The results are consistent with the previous studies and the change of economic states was captured. Moreover, we could see a possibility to develop more complex models intuitively using graphical models, that would be more interpretative models for finance.