Suppose I have a (left) stochastic matrix $P$, i.e. a non-negative matrix with column sums equal to 1. Its maximum eigenvalue will be equal to 1, and the corresponding eigenvector $\mathbf q$, if it's unique, can be interpreted the stationary distribution of a stochastic process with transition probabilities $P$.
Now suppose I have a family of stochastic matrices, $P(x)$, characterised by a real parameter $x$. I would like to know how the leading eigenvector $\mathbf{q}$ changes in response to a small change in $x$. In other words, given the values of $p_{ij}$ and $\frac{dp_{ij}}{dx}$, I would like to know $\frac{dq_i}{dx}$.
I'm aware that there is a general method for calculating the derivatives of eigenvectors. However, it's a little bit complicated, and I get the feeling it should simplify in this case, since we know that the leading eigenvalue must remain equal to 1 as the matrix changes.
Since $\mathbf{q}(x)$ is to be interpreted as a probability distribution, it's advantageous to assume it's normalised as $\sum_i q_i=1$, rather than $\mathbf{q}^T\mathbf{q}=1$.
I'm happy to accept answers that assume the leading eigenvector is unique (i.e. $P$ is primitive), but if there's an elegant way to handle the other cases, that would be great.