To create a simulated environment or extrapolate a dynamically changing theta from a simulated, experimental, or real environment, functions and equations can be used by adding or subtracting functions to affect the generational cycles as represented in R studios. Alternatively, by introducing a wide variety of complex methods
3.1
The effects of selection, mutation, and migration on genetic variation can be modeled by adopting a framework similar to that outlined by Gillespie (2004), where evolutionary forces are quantitatively analyzed for their impact on allele frequencies. This approach will ensure that the simulation for the given populations will remain as realistic as possible. (Gillespie, J. H., 2004)
The function used will be in differential form at first \(\frac{dp}{dt}\) then we can derive \(\frac{d\theta }{dt}\)based on the original function of \(\frac{dp}{dt}\). This simulation will handle these processes discretely per generation however, we can conceptualize a continuous approximation for the rate of change of the allele frequency \(p\) over time \(t\) as follows:
$$\frac{dp}{dt}= Mutation + Migration + Selection + Environmental Effects$$
Defining each term:
Each of these variables will represent an evolutionary effect and are chosen to showcase a simplified model using the program R Studios.
3.1.1. Mutation
The mutation term incorporates both forward \(A\Rightarrow a\) and reverse \(a\Rightarrow A\) mutations at rates \(u\) and \(v\):
$$Mutation = -up+v(1-p)$$
3.1.2 Migration
Migrational effect on the referenced populations alleles. will depend on the difference between the allele frequency in the sample population \(p\) and the sampled allele frequency in the migrant population \({p}_{m}\), This impact is then scaled by the constant \(m\):
$$Migration = \left(m\right({p}_{m}-p\left)\right)$$
3.1.3 Selection
Selection is modeled using the following selection coefficients: \({s}_{A}\) for advantage, and \({s}_{a}\) for disadvantage. This assumes selection acts directly on the allele A, the simplified model is represented as:
$$Selection = \left({s}_{A}p\right(1-p)-{s}_{a}p(1-p\left)\right)$$
This form presupposes \({s}_{A}\) enhances and \({s}_{a}\) reduces the frequency of A with a steady constant; however, it could be simplified or adjusted based on the specific selection dynamics being modeled.
3.1.4 Environmental Effects
Environmental effects, such as climate change, predation, and food availability, dynamically affect the individual population or allele frequencies. These effects are greatly simplified as a growth rate per generation in the example model. This can be represented as \(E\)affecting the population's growth rate and assumes an indirect impact on its allele frequencies:
$$Environmental Effects = \left(E\right(t\left)p\right(1-p\left)\right)$$
where \(E\left(t\right)\) represents the combined effect of climate change, predation, and food availability on allele frequency as a function of time.
3.1.5 Combined Differential Equation
Combining these components gives us a model for the change in allele frequency over time due to mutation, migration, selection, and environmental effects:
$$\frac{dp}{dt}=(-up+v(1-p\left)\right)+\left(m\right({p}_{m}-p\left)\right)+\left({s}_{A}p\right(1-p)-{s}_{a}p(1-p\left)\right)+\left(E\right(t\left)p\right(1-p\left)\right)$$
3.2 Representation of difference of theta over a difference in time,\(\frac{d\varTheta }{dt}\)
Now to express the change in allele frequency over time in terms of \({ \theta }_{g}\)to represents the phase related to a set of allele frequencies. With the original equation for the rate of change of \(p\) and by expressing \(\frac{dp}{dt}\) in terms of the \({ \theta }_{g}\).
Step 1: Expressing \(\frac{dp}{dt}\) in terms of\(\frac{d\theta }{dt}\)
$$co{s}^{2}\left({\theta }_{p}\right)=p$$
And since
$${\theta }_{p}=co{s}^{-1}\left(\sqrt{p}\right)$$
We have
$$\frac{d\theta }{dp}=\frac{d}{dp}co{s}^{-1}\left(\sqrt{p}\right)$$
Step 2: Differentiating \({\theta }_{p}\)in terms of\(p\)
In order to find \(\frac{d\theta }{dt}\), First we need to use the chain rule.
$$\frac{d\theta }{dt}=\frac{d\theta }{dp}\cdot \frac{dp}{dt}$$
Next, finding the derivative of \({\theta }_{p}\)in terms of\(p\)
$$\frac{d\theta }{dp}=\frac{d}{dp}co{s}^{-1}\left(\sqrt{p}\right) \Rightarrow \frac{d\theta }{dp}=-\frac{1}{2\sqrt{p(1-p)}}$$
Applying \(\frac{d\theta }{dp}\) to get \(\frac{d\theta }{dt}\)for the simulation
$$\frac{d\theta }{dt}=(-\frac{1}{2\sqrt{p(1-p)}})\cdot (-up+v(1-p\left)\right)+\left(m\right({p}_{m}-p\left)\right)+\left({s}_{A}p\right(1-p)-{s}_{a}p(1-p\left)\right)+\left(E\right(t\left)p\right(1-p)$$
Conceptually, this equation will represent the GPA rate of change in response to evolutionary pressure on the given allele or population Figs. 2 and 3.
This equation is more detailed and is a continuous approximation of the processes modeled in R studios. Nevertheless, this model's assumptions, particularly regarding constant selection pressures and migration rates, represent a simplification of complex evolutionary forces. Future models could incorporate variable environmental factors and stochastic events to more accurately reflect the unpredictability of natural systems.