In a final step, we can also go further and include new probabilities for the absorbing states.

pattern <- new("Pattern", sequence = c("P9", "P2"), absorbingProbabilities = data.frame(Buy = 0.5, Defer = 0.5))
predict(mc2, startPattern = pattern, dist = 1)
Sequence: P1
Probability: 0.6666667
Absorbing Probabilities: 
        Buy     Defer
1 0.3509431 0.6490569

Exercise

Predict the next value for the sequence P5 and P11, as you did in the previous exercise, by using the model and store it as next_state. Note that the probability of buying is 20%. Also calculate the probability that this state will be the next state and store it as prob_next_state.