I am currently reading an article on Wikipedia on how to derive the mean time before fixation $k_i$ of the Moran Model.
But the derivation of this result rests on this equation:
$$ k_i^j = \delta_{ij} + k_{i-1}^{j}p_{i,i-1} + k_{i}^{j}p_{i,i} + k_{i+1}^{j}p_{i,i+1} $$
where $k_i^j$ is the mean time spent in state $j$ when starting in state $i$.
The problem I have is with the equation above, why does this equation hold? Or is it simply a definition?
I would appreciate if I get references for further reading.
Thank you.
the Moran Model is a version of the gambler's ruin problem. The difference here is that the probabilities to go up or down depend on the position. However, the solution strategy is the same.
The computation uses something that is called "first step analysis". Let $T$ be the fixation time, then
$$k_i^j:=E\left[\sum_{n=1}^{T-1}1_{X_n=j}|X_0=i\right]$$
It should also be intuitive that $$E(T|X_0=i)=1+\sum_{j=0}^{N-1}k_i^j$$
I think it is more intuitive/instructive to work with the latter quantity. For $i\in\{1,\ldots,N-1\}$
$$E[T|X_0=i]=\frac{1}{P(X_0=i)}E[T\cdot 1_{X_0=i}] =\sum_{j=-1}^1\frac{1}{P(X_0=i)}E[T\cdot 1_{X_0=i}\cdot 1_{X_1=i+j}]\\ =\sum_{j=-1}^1\frac{P(X_1=i+j,X_0=i)}{P(X_0=i)}\cdot\frac{1}{P(X_1=i+j,X_0=i)}E[T\cdot 1_{X_0=i}\cdot 1_{X_1=i+j}]\\ =\sum_{j=-1}^1p_{i,i+j}E[T|X_0=i,X_1=i+j]=\sum_{j=-1}^1p_{i,i+j}E[T|X_0=i+j] $$ The last step uses time homogeneity and Markov property, and $1_A$ is the indicator function of event $A$.
Now, abbreviate $h(i):=E[T|X_0=i]$ and you get the system of linear equations
$$h(i)=0, \text{if $i\in\{0,N\}$} \\ h(i)=p_{i,i-1}h(i-1)+p_{i,i}h(i)+p_{i,i+1}h(i+1) $$
You can do the same for $k_i^j$, but it's unnecessary information if you're only interested in the mean time to fixation.
You can find a more general description of the whole method in Nicolas Privault's book "understanding Markov Chains". He also has a free version of his script on his website.