## In this example: the probability to reach a score of a in the third excursion is: 0.04237269
## The conditional probabilities to reach a score of a in the third excursion if the first
## letter of the sequence is K, L or M are respectively: 0.04239004, 0.04247805 and 0.04222251
proba_theoretical_ith_excursion_markov(a = 5,
theta = c("K","L","M"),
lambda = matrix(c(0.5, 0.3, 0.2,
0.4, 0.2, 0.4,
0.4, 0.4, 0.2),
ncol = 3, byrow = TRUE),
score_function = c(-2,-1,2),
i = 3,
prob0 = c(0.4444444, 0.2962963, 0.2592593))
### This example implements the numerical application of the paper,
### the global probability is 0.2095639
proba_theoretical_ith_excursion_markov(a = 6,
theta = c("a","b","c","d","e"),
lambda = matrix(c(0.1, 0.7, 0.05, 0.05, 0.1,
0.3, 0.3, 0.2, 0.15, 0.05,
0.1, 0.4, 0.15, 0.2, 0.15,
0.5, 0.05, 0.25, 0.1, 0.1,
0.25, 0.05, 0.5, 0.15, 0.05),
ncol = 5,nrow=5, byrow = TRUE),
score_function = c(-3,-2,-1,6,7),
i = 3)
Run the code above in your browser using DataLab