# How to check if a population density obeys replicator dynamics

Say we have a probability vector or population density $$p = (p_1,...,p_n)$$ with $$p_i \geq 0$$ and $$\sum_i p_i =1$$. Also assume we know the functions $$g=(g_1,...,g_n)$$ such that:

$$p_i(t+1) = g_i(p(t))$$

where $$t$$ is a discrete time index. Is there a way to check whether $$g$$ implements a discrete time replicator equation? I.e. whether there is a function $$f=(f_1,...,f_n)$$, called the fitness landscape, such that:

$$p_i(t+1)= \frac{f_i(p(t))}{\langle f \rangle_{p(t)}} p_i(t).$$

where $$\langle f \rangle_{p(t)}:=\sum_j p_j(t) f_j(p(t))$$ is the average fitness of the population density. Pluggin in $$g_i(p(t))$$ gives an equation that we could try to solve for $$f$$ but I don't know how:

$$g_i(p(t)) = \frac{f_i(p(t))}{\langle f \rangle_{p(t)}} p_i(t)$$

or equivalently:

$$\frac{g_i(p(t))}{p_i(t)} = \frac{f_i(p(t))}{\langle f \rangle_{p(t)}}.$$

We can of course also drop the time dependency and write:

$$\frac{g_i(p)}{p_i} = \frac{f_i(p)}{\langle f \rangle_{p}}.$$

Is there a (in the best case necessary and sufficient) criterion that has to be satisfied for this equation to have a solution? I am also grateful for tips how to tackle this problem in a principled way, including numerically.

For discrete time replicator dynamics, fitness is defined only up to a multiplicative factor. I.e. if you pick some number $$k$$ then $$(f_1, ..., f_n)$$ defines the same fitness function as $$\hat{f} = (f_1/k, ..., f_n/k)$$. In particular, this mean for any $$p$$ you can always pick a $$k$$ such that $$\langle \hat{f} \rangle_p$$ = 1.
So using your final equation, just let $$\hat{f}_i(p) = g_i(p)/p_i$$.
Note that the resulting landscape $$\hat{f}$$ will be a relative fitness landscape and not an absolute fitness landscape. But there is no way to recover an absolute fitness landscape from the data you have. You would need information on how the population size, not just frequencies evolved for that.