Estimating a dynamic switching process

A follow-up note which might help:

I think the problem is that there is a very large number of possible combinations of the r(k) sequence for large N. I’m hoping there is some kind of method which can explore the possible solutions according to their likelihood and ignore unlikely ones (i.e. an approximate approach). However, the shock occurrence is quite unlikely (0.01) so at least some of them have to be included. Maybe this part is a dynamic programming problem?