We consider a self-exciting counting process, the parameters of which depend
on a hidden finite-state Markov chain. We derive the optimal filter and
smoother for the hidden chain based on observation of the jump process. This
filter is in closed form and is finite dimensional. We demonstrate the
performance of this filter both with simulated data, and by analysing the
`flash crash' of 6th May 2010 in this framework