I have been working on time series analysis, I have written a code in matlab to simulate the second order markov chain based on the transnational probability but the time of computation is 7 min, which I need to reduce. My time series data has 10455 time point and value in each time point ranges between (1-88).