Determining the Number of Regimes in Markov-Switching VAR and VMA Models