Detecting bearish and bullish markets in financial time series using hierarchical hidden Markov models. (April 2023)