Markov Switching Model


I am currently working on modeling worldwide semiconductor shipments. It is well known that the semiconductor industry is cyclical. In particular there is an inventory buildup state and an inventory burn state. The value chain of this industry tends to exaggerate both demand for semiconductors as well as understate supply for semiconductors. This is what I’ve gathered from speaking with sell-side Wall Street research analysts.

My goal is to find the two state (inventory buildup and inventory burn) switching probabilities as well as the state durations. I want to use R for this goal.

Does R have any packages that will help me do this? I checked CRAN website and couldn't find any packages that would help me. But I may have overlooked given that I'm not very familiar with Markov Switching Models.

Thank you for your help.