0

The data frame looks like this:

 ID     path    conversion
  1      A          1
  2      B          0
  3      A          0
  4  B > C          0
  5      A          0
  6  A > A          0

I have created the markov model using the function:

ma <- markov_model(df,
                   var_path = 'path',
                   var_conv = 'conversion',
                   out_more = TRUE)

I have a very large data set and have created a Markov chain. Before I was using 6 variables and when viewing the transition matrix, it seemed fine. However when I added an extra variable some of the probabilities gave an infinite value. Some channels do not go to each other and the probability is not shown, which I understand, but I dont understand the Inf value. I think they should be zeros as there is little/no movement from each of those channels but I dont know why it doesn't show this.

ma$tranisiton_probabilities gives    
channel_from         channel_to        transition_probability
    1         (start)        A                  0.816666667
    2         (start)        B                  0.150000000
    3         (start)        C                  0.025000000
    4         (start)        D                  0.008333333
    5               A   (conversion)            0.860215054
    6               A        D                  0.078853047
    7               A        B                  0.057347670
    8               A        C                  0.003584229
    9               B        A                      Inf
    10              B        D                      Inf
    11              C        A                      Inf
    12              D        A                      Inf
deez
  • 50
  • 8
  • How are you generating the transition probabilities? Hard to say what the problem is, only looking at the end result here. As an aside, is there a rationale for using a long form table instead of an actual matrix? – caw5cv Mar 13 '18 at 11:35
  • I need the long form table, as I am using a column in my data frame that has the path. Ill add the column to the question. I am generating the transition probabilities using the markov_model function – deez Mar 13 '18 at 11:44
  • Smells like a division by zero somewhere. Impossible to say without the actual data though. – Mikko Marttila Mar 13 '18 at 11:47
  • I have edited it to show what I am doing – deez Mar 13 '18 at 11:48
  • Any chance you found a solution to this problem? – Vlad C. Jan 02 '19 at 17:50

0 Answers0