![]() ![]() The CCM algorithm should converge to a stable approximation of causality as the library size increases. To conduct CCM, we need to specify the number of dimensions to use for shadow manifolds, E, the lag time, tau, and the library size, L. If the algorithm works as it should, we will see a clear indication that the two populations are causally linked. Below, we’ll test whether CCM can detect this relationship. Figure 2: Trajectories and direction fields of the predator-prey systemįrom the system of equations above, we know there is a causal relationship between the predator and prey, and we have visualized the common manifold. In CCM terms, this is a visualization of the underlying manifold of the dynamical system. With these parameters, we can visualize the trajectory and direction field of the system of equations, which is shown below (I’m not including ploting code here for brevity, but see this tutorialif you’re interested in making these plots). Plt.title('Population Dynamics', size=15)įigure 1: predator and prey population dynamics Plt.plot(np.arange(tsteps+1), pred, label = 'Predator') Plt.plot(np.arange(tsteps+1), prey, label = 'Prey') ![]() Prey) - d * pred) # Predator growth equation Pred = (pred + c * a * prey * pred / (np.power(pred, m) + a * h * Prey = (prey + b * prey * (1 - prey / K) - (a * prey * pred) / (np.power(pred, m) +Ī * h * prey) - z * prey) # Prey growth equation # harvesting, which we will keep at 0 for this example # create arrays to store predator and prey populations ![]() Tsteps = 120 # number of timesteps to simulateĬ = 0.30 # rate that prey is converted to predator There is also an interactive Jupyter notebookin our recently published eBook on Uncertainty Characterization for Multisector Dynamics Research. For more details on the Fisheries system, see the training blog posts by Lillian and Trevor ( part 0, part 1, part 2). In the cell below, we’ll simulate this system for a given set of environmental parameters (a, b etc.), and plot the dynamics over 120 time periods. Where x and y represent the prey and predator population densities, t represents the time in years, a is the prey availability, b is the prey growth rate, c is the rate at which prey is converted to new predators, d is the predator death rate, h is the time needed to consume prey (called the handling time), K is the carrying capacity for prey, m is the level of predator interaction, and z is the harvesting rate. The simulation uses two differential equations to model the dynamics of the predator-prey system: This system models the population dynamics of two species, a predator and a prey. We’ll start by simulating the predator-prey system used in Hadjimichael et al., (2020). Simulating the fisheries predator-prey system I also found the series of videos created by the authors to be extremely helpful. For a more detailed explanation of CCM, I highly recommend reading Sugihara et al., 2012. Using this concept, CCM develops “shadow manifolds” for system variables, and examines the relationships between shadow manifolds using cross mapping, which involves sampling nearest-neighbor points in one manifold, and determining if they correspond to neighboring points in the other. If variable X has a causal effect on variable Y, then information about X should be encoded in variable Y, and we can “recover” historical states of X from the historical time series of Y. Rohini wrote a great blog post about CCM in 2021, so I’ll just provide a quick summary here and refer readers to Rohini’s post for more details.ĬM harnesses the idea that the dynamics of a system can be represented by an underlying manifold, which can be approximated using lagged information from the time series of each variable of interest. Convergent Cross MappingĬCM is a technique for understanding causality in dynamical systems where the effects of causal variables cannot be separated or uncoupled from the variables they influence (Sugihara et al., 2012). This demo follows the basic procedure used in the tutorial for the causal_ccm package, which you can find here.Īll code in this blog post can be found in a Jupyter notebook in this Github repo. To conduct CCM, we’ll use the causal_ccm Python package by Prince Joseph Erneszer Javier, which you can find here. This post demonstrates the use of Convergent Cross Mapping (CCM) on the Fisheries Game, a dynamic predator-prey system.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |