0

I have a numpy array with data that have two states either "0" or "1" - for three days (3 rows).

Something like that:

data=np.array([[0, 0, 1, 1, 1, 0, 0, 1], [0,1, 1, 1, 0, 0, 0, 0], [0,1, 1, 0, 0, 0, 0, 0]])

As these are timeseries for 7 timesteps I would like to create a transition matrix a with size A [27 x 27].

The question is: Is there any library that creates the transition matrix? I found a relevant question but doesn't help much. I am asking because I will have multiple timeseries so to compute the matrix manually will be impossible.

Thanks in advance

teratoulis
  • 47
  • 5
  • Have you seen [this](https://stackoverflow.com/questions/46657221/generating-markov-transition-matrix-in-python/46657489) related question? – Axel Kemper Dec 22 '21 at 10:16
  • yep, didn't really understand how it works for n timeseries data. In this question it puts them in a string however I don't fully get it, as I am a beginner in python – teratoulis Dec 22 '21 at 10:47

0 Answers0