Markov Chain and Removal Effect Based on this article
I'm  trying to use within R the Channel Attribution package to leverage on the Markov Chain in order to attribute conversion between several marketing channel.
On one point the author suggest:
" When using one-order Markov chains, a subsequence of the same channels in a path (duplicates) can be reduced to one channel (for example C2 in the path C1 → C2 → C2 → C2 → C3 can be reduced to C1 → C2 → C3). Because, mathematically, it doesn’t matter how many times each C2 goes through the loop with itself in the transition matrix, it will be in the C3 state finally. Therefore, we will obtain different transition matrices but the same Removal Effect for channels with or without subsequent duplicates ".
Now, I utilized another set to validate the package result. Specifically:

If I take the example in the picture, where I simulated an hypothetical set of paths, with both number of conversions and not conversions represented in the coloured cells (in the green and red cells respectively)
Doing the math by hand I get the following transition probabilities for the 1st order Markov chain:

However, when I do the calculation by hand to get the removal_effect and total_conversion, I do not get the same results of the package for each channel.
According to the theory and the example in the article, the total probability of conversion of the model should be = (1*0.1008*0.5455*0.1261) + (0.1765*0.2605*0.0323) +(0.2605*0.3226*0.1818) + 0.1261=0.1498
Then the removal effects:
google= 1-(0/0.1498)=1
facebook=1- ( (0.0015+0.1261)/0.1498)=0.1482
instagram=1-((0.0069+0.1261)/0.1498)=0.1121
Then to compute the share of conversion, let's say of google
share google=1/(1+0.1482+0.1121)=0.7935 * 20 conversions =15.87
while the attribution channel package give me different results as per below 

I think I'm missing something in my calculation respect to what the code does.
Does anyone with some experience with Markov chain help with identifying what is not right in the manual computation?
Many thanks
D
 A: The transitional probabilities that you have calculated are not matching with the R output, because you need to remove the line item google to google (row 3 in your table). I have eliminated the line item and my output is in line with the R output. Please see image below. 

However, I am not able to get the same removal effects, as the R output. Still trying. Please let me know if you have any success.
A: According to the official documentation of the package ChannelAttribution:

The approach basically follows the one presented in Eva Anderl, Ingo Becker, Florian v. Wangenheim, Jan H. Schumann (2014). Differently for them, we solved the estimation process using stochastic simulations. In this way it is also possible to take into account conversion values and their variability in the computation of the channel importance.

So, although there is no clear documentation about the computational steps, I think the flow is:


*

*1) calculation of conversion rate for each channel;

*2) for all the channels $C_1, C_2, \dots, C_n$: 


*

*2.1) remove the channel $C_i$ from the graph ;

*2.2) recalibrate transitional probabilities (not sure if this is actually done);

*2.3) according to the new transitional probabilities, simulate $N_{sim}$ paths (in the package, there is the nsim parameter in the markov_model function) and from these new paths, calculate the new conversion rate;


*3) calculate the removal effects of each channel.


Let me know if you have new updates from your side.
