State space Markov switching models using wavelets