1. Introduction
The ability to learn from the local environment plays a crucial role in the survival of species. Various processes, such as interactions within social groups, competition with members of the same species, foraging behavior, and predator avoidance, profoundly influence how a species navigates and behaves in its surroundings [
1,
2,
3]. Understanding and predicting the territories of different species depend on comprehending these processes. A compelling example of this phenomenon can be observed in wolves, where their movements are guided by vital information, including the scent of their pack, the scents of fellow pack members, pack density, and the location of wolf pups [
4]. Spatial ecology has a keen focus on unraveling the mechanisms that underlie species movement and how these movements contribute to territory decisions. In light of the effects of climate change on the environment [
5,
6] and its impact on species’ territories [
7], these issues have gained increasing importance in scientific research.
Mathematical models leverage the mechanisms underlying territory decisions to predict how territories adapt in response to environmental changes, such as alterations in conspecific territories or resource density [
8]. Specifically, mechanistic models offer a framework to investigate territory formation, building upon theories developed by field scientists for species movement. These models provide some advantages over statistical models, as they facilitate hypothesis testing for the driving forces behind animal movement, exhibit strong predictive capabilities, and can be validated using field measurements [
9]. Mechanistic models have proven useful in describing various behaviors, including foraging [
10,
11], aggregation [
12], and home ranges [
13,
14]. They encompass movement processes, conspecific influences, environmental pressures, and space utilization [
15,
16,
17]. Earlier models, such as those proposed by [
18,
19], incorporated diffusion and attraction to a central location, like a den site, to describe territories across different species. Over time, these models have been enriched with additional processes to better replicate territory patterns based on empirical data, including aspects like scent marking [
9] and habitat selection [
20]. Local advection–diffusion (AD) models have proven successful in predicting territories for species like wolves [
4], coyotes [
9], and meerkats [
17]. For instance, in the case of meerkats, location data and environmental information are integrated into a local mechanistic model, enabling parameter estimation to describe territory formation among social groups of meerkats. One crucial feature of these models, which in some cases ensures their well-posedness, is an attraction to fixed den sites. In a way, den-site attraction represents the use of very specific nonlocal information, making these models well-suited for species known to maintain fixed den sites.
Numerous mechanistic models proposed to understand animal territory formation have traditionally assumed that animals base their decisions solely on local information. However, the process of gathering information about the environment inherently involves nonlocal aspects. Animals rely on observations, sounds, and smells to gain insights into distant surroundings [
21,
22,
23]. Additionally, studies have highlighted the significance of nonlocal advection in maintaining swarm coherence [
24] and ensuring well-posed solutions in certain models [
25,
26]. Furthermore, field observations of meerkats have provided evidence that they actively avoid locations where they have encountered members of rival groups previously, further emphasizing the importance of nonlocal interactions in certain species [
17,
27]. As a result, mechanistic models incorporating nonlocal advection have garnered recent interest [
25,
28,
29], along with relevant references. This study focuses on a nonlocal advection–diffusion model that elucidates the territory formation of social species with subgroups. However, nonlocal models pose both mathematical and computational challenges, as classical theories may not be applicable, and numerical methods can be computationally demanding [
25,
30,
31]. Overcoming these challenges is crucial to investigating the behavior of two-dimensional solutions involving multiple interacting species and effectively connecting the model with empirical data.
In this study, we present an efficient spectral numerical scheme designed to solve a nonlocal advection–diffusion equation, specifically aimed at handling a large number of interacting species. Spectral methods have been shown to be efficient in a variety of contexts, including fluid mechanics [
32], higher order reaction-diffusion equations [
33], and integro-differential equations [
34]. We dive into investigating the impact of various factors, such as the interaction potential, environmental conditions, diffusion strength, and the number of groups, on the behavior of equilibrium solutions. Our findings reveal that a change in the variance of an interaction potential has a pronounced effect on a population’s territory. Moreover, we observe that the delicate balance between diffusion and aggregation strengths significantly influences the computational efficiency of the numerical solutions. Furthermore, our approach incorporates environmental data, which plays a crucial role in influencing species movement through diverse mechanisms. To test the validity of our method, we employ synthetic data and implement a data fitting technique that employs maximum likelihood estimation and stochastic gradient descent. Through this process, we aim to discern the primary driving forces behind the movement of social groups, shedding light on the intricate dynamics governing species’ behaviors.
Outline: In
Section 2, we provide the motivation for our study and introduce the mechanistic model under investigation.
Section 3 is dedicated to describing the numerical scheme designed for a general nonlocal advection–diffusion equation in two dimensions. Here, we explore the influence of model parameters on the behavior of solutions and discuss the computational implications of adding more groups to the system. Moving on to
Section 4, we integrate synthetic data into the model and employ maximum likelihood estimation to analyze the primary driving forces behind species movement. Finally, our conclusions are presented in
Section 6, summarizing the key findings and implications of our study.
2. Background and Model
In their work [
17], Bateman and colleagues explored various local advection–diffusion models to study meerkat movement. They linked these models to spatial-temporal field data, encompassing the location of meerkats from 13 different groups. The core model they considered for
N groups is as follows:
Here,
,
, and
. The density of group
i is represented by
,
D denotes the spatial diffusion rate, and
is the velocity field. Each group is advected towards its home center by the unit vector
. The model has two versions: one where groups move away from direct interactions with conspecifics, and another where they move away from scent markings by conspecifics. The authors incorporated data from three distinct time periods into various versions of Equation (
1) and assessed which models better fit the data for each period. The specific conclusions of their study are not mentioned. However, one drawback of models like (
1) is the reliance on artificial home centers to maintain group coherence, which is not observed in meerkat populations. To address this, the current study aims to develop a nonlocal model that eliminates the need for such artificial centers. An efficient numerical scheme is introduced to explore the qualitative behavior of the system and facilitate the data-fitting process. The proposed nonlocal mechanistic model is given by:
where
The model considers information gathering through local and nonlocal mechanisms and incorporates. The first term appearing on the right-hand-side of Equation (
2) is an intra-group dispersal modulated by the parameter
. Note that the diffusion is not passive but rather a power-law, modeling an overcrowding effect, which results in higher group dispersal rates with larger population densities. The convolution terms capture long-range intra-group aggregation (governed by potential
) and inter-group repulsion (governed by potential
). These terms are responsible for maintaining group coherence and promoting segregation between groups. Note that we assume that the potentials
and
are symmetric and satisfy conditions that guarantee that aggregation. The term
U describes the environment’s favorability. As an example, for meerkat territory development, it could represent the density of sour grass. The study in [
17] takes into account various environmental traits, such as sand type, interfaces between sand types, and elevation, as detailed in
Section 5.1.
Table 1 offers a concise overview of the descriptions associated with the terms involved in Equation (
2). This equation represents a competition involving various factors: the diffusion term facilitates population spread, intra-group long-range aggregation concentrates the population (assuming
serves as an aggregation potential), inter-group interaction disperses territories, and the environment assigns significance to additional environmental elements. The qualitative behavior of solutions to this system will consequently hinge on which factors dominate the dynamics. We adopt the notation used in [
35] and set
and
, where
and
are positive constants, and
K is a kernel. Based on this notation, we formulate an associated energy functional for (
2) as follows:
When
, the energy functional is non-increasing over time [
35]. Equilibrium solutions of the system can be obtained by minimizing this energy, and a way to do this numerically was explored in [
36]. One can employ a scaling argument based on the energy functional (
3) to demonstrate that when we have aggregative potentials
and
, the behavior of the minimizers will be influenced by the relative strengths of these terms.
A variant of System (
2) was applied in the study of animal ecosystems with multiple groups [
37]. In that context, it was assumed that each population can detect opposing populations within a local neighborhood through direct observations, interactions, communication via scent marking, or memory of past interactions with opposing populations. Another version of System (
2) was introduced in [
38] to model social segregation. While the case when
has received significant attention [
31,
39,
40,
41], as well as versions for
[
42,
43], the model has been utilized to study diverse phenomena such as animal territories [
26], predator/prey dynamics [
44], and human gangs [
45]. Its behavior is further investigated in [
36], where the authors explore methods to find equilibrium solutions for multiple groups in two dimensions, a critical aspect in connecting the model with data. Additionally, in [
35], the authors investigate the efficient solution of a multi-species model using spectral methods in one dimension and two interacting species.
4. Incorporation of Synthetic Data
We are able to use synthetic data obtained from equilibrium solutions to System (
2) to explore parameter inference via maximum likelihood estimation. In this section, we use the same environment
U and potential
K as was used
Figure 1. We generate synthetic data by rejection sampling. Specifically, we choose the coordinate pair (
,
) at random from the domain and
at random from a uniform distribution on the interval
. If
, where
f is the probability density function found from the equilibrium solution to (
2), we add the data value
to the set. We continue until we have the desired number of data points.
Given the set of synthetic data with
M data points for each of
N groups,
, we minimize the negative log-likelihood function over the set of parameters,
:
The probability density functions,
, are found using the methods described in
Section 3, with initial condition determined by the kernel density estimation of the set of synthetic data. We use stochastic gradient descent (SGD) to minimize the negative log-likelihood function. SGD uses one or a few data points to update the parameter at each iteration. This leads to more variance in the update, thus allowing a possibility to move away from a local minimizer. We update the parameter as follows:
where
m is a randomly chosen from the set
, and
is the learning parameter, which typically decreases with time. To keep within a stable parameter range, we have the bounds
and
.
4.1. Data Fitting with One Parameter
In this section, we explore parameter estimation, with an emphasis on a single parameter. To assess potential variations in the estimation of different parameters, we have opted to separately investigate the estimation of the parameters and b. Given that territory formation hinges on the interplay between aggregation and diffusion, and our chosen territory primarily serves the purpose of aggregating the population, we opt to exclude the parameter .
4.1.1.
Figure 6 illustrates an instance of fitting parameter
b to synthetic data for a particular group through the aforementioned methodologies. The process of Stochastic Gradient Descent (SGD) is depicted in
Figure 6a, showcasing the progression of negative log-likelihood values and the corresponding estimated parameter values throughout each iteration. The equilibrium solution employed in generating the data are represented in
Figure 6b, while the equilibrium solution derived from the parameters estimated via SGD is displayed in
Figure 6c. The inferred equilibrium solution closely aligns with the genuine equilibrium solution’s territory, although the latter exhibits greater symmetry and a slightly heightened peak value.
To assess convergence frequency and the impact of dataset size, we conducted 60 maximum likelihood estimation trials to fit
b using data generated from
. We explored three dataset sizes:
,
, and
, presenting the outcomes in
Figure 7. A significant majority of trials clustered around the true parameter value of
, with fewer deviating. This trend intensified as dataset size increased, supported by decreasing variances:
,
, and
, respectively.
In a similar vein,
Figure 8 fits the parameter
using data generated from
. The iterations of SGD are depicted in
Figure 8a, the equilibrium solution employed in generating the data are represented in
Figure 8b, while the equilibrium solution derived from the parameters estimated via SGD is displayed in
Figure 8c. As we saw previously, the estimated equilibrium solution closely aligns with the true equilibrium solution’s territory with less symmetry.
Figure 9 analogously assesses convergence frequency and the effect of data set size for
. Via 60 maximum likelihood estimation trials, we fit
to data generated from
for three different data set sizes. Average values closely aligned with the true parameter although, interestingly, trial averages consistently underestimated the actual parameter value. Furthermore, as dataset size increased, variance diminished:
,
, and
, respectively.
4.1.2.
In
Figure 10, we estimate
b from data generated with
,
,
in the case of two interacting species. In this case, the algorithm does not converge to the parameter the data were generated with, but converges to a parameter value that has a lower log-likelihood value. The parameter
b is slightly overestimated, which leads to a more aggregated estimated territory in
Figure 10c than the genuine territory depicted in
Figure 10b. Additionally, the estimated territory has a higher maximum value and is less symmetric than the true territory.
In
Figure 11, we similarly estimate
from data generated with
,
,
, and
. The algorithm underestimates
and converges to a lower log-likelihood value than that of the true parameter value. This underestimation of
is in line with the pattern we saw in
Figure 9. It is again worth comparing the territory used to generate the data with the predicted territory.
Figure 11c shows the equilibrium solution found using the parameters predicted from SGD, and
Figure 11b shows the equilibrium solution used to generate the data. The territory boundaries are similar, with the true territory being more symmetric, more spread out, and having a slightly lower maximum value.
4.2. Data Fitting with Two Parameters
In this section, we fit two parameters to the two-species model. As in previous sections, we fit parameters to synthetic data generated for and , but in this case, we fit both b and to the data.
4.2.1.
When we simultaneously adjust both
b and
to match the model, our focus lies in the ratio of these parameters. This emphasis arises from the fact that the specific environment used induces territory aggregation as
b increases, whereas territory dispersion occurs as
increases. This behavior can be seen mathematically through a scaling argument applied to the energy function (
3). As a consequence, overestimating or underestimating both parameters tends to offset each other and results in a comparable territory outcome. In
Figure 12, we fit the model with data generated using
and
.
Figure 12a illustrates that the algorithm converges to approximately
and
, with both parameters being underestimated. However, while a lower
b leads to less aggregated territory, a lower
also results in a less spread-out territory. These effects can counterbalance each other, resulting in a territory resembling the one used to generate the data. The equilibrium solutions for System (
2) with the parameters used for data generation and the estimated parameter set are depicted in
Figure 12b,c. These parameter sets yield similar territory boundaries, highlighting this phenomenon.
Figure 11.
Iterations of SGD minimizing the negative log-likelihood function to estimate
using data generated with
,
,
,
, and
and the equilibrium solutions to System (
2) using the parameter used to generate the data and the estimated parameter. (
a) Iterations of SGD and corresponding estimated
(
top) and negative log-likelihood value (
bottom). (
b) PDF used to generate data. (
c) PDF from estimated parameters.
Figure 11.
Iterations of SGD minimizing the negative log-likelihood function to estimate
using data generated with
,
,
,
, and
and the equilibrium solutions to System (
2) using the parameter used to generate the data and the estimated parameter. (
a) Iterations of SGD and corresponding estimated
(
top) and negative log-likelihood value (
bottom). (
b) PDF used to generate data. (
c) PDF from estimated parameters.
4.2.2.
In
Figure 13, we demonstrate fitting
b and
to synthetic data when
.
Figure 13a illustrates that
b and
are both overestimated. As we have seen previously, overestimating both parameters can balance out and lead to a comparable territory to the true equilibrium. This is demonstrated when comparing the true territory,
Figure 13b, to the estimated territory,
Figure 13c. The estimated territory is similar to the true territory, it is more aggregated and has a higher maximum value. As is true of other estimated territories, the genuine equilibrium solution is also more symmetric.
6. Discussion and Conclusions
Nonlocal mechanistic models provide a more realistic approach for modeling species with consideration of nonlocal information during territory formation. However, these models come with higher computational costs compared to local models. Incorporating data into such models requires multiple iterations across parameter space, especially for complex systems with multiple species. Thus, achieving efficient solutions becomes crucial. In this study, we use a nonlocal mechanistic model to depict territorial behaviors reliant on nonlocal information. Our approach efficiently handles system complexities using spectral methods, known for their efficiency in numerical schemes. We investigate computation times across different parameter settings and species numbers, examining the influence of parameters and system terms on solutions. The results in
Table 2 indicate that finding the equilibrium for seven species takes approximately one hour. We find that balanced diffusion and aggregation lead to quicker equilibrium solutions.
Utilizing our numerical method, we generate synthetic data and use maximum likelihood estimation to infer model parameters. We perform parameter estimation for cases involving one or two parameters and one or two species. Multiple trials enhance estimation accuracy, with larger datasets narrowing parameter prediction ranges. Our primary findings emphasize the efficiency of spectral methods for nonlocal systems, coupled with the feasibility of data incorporation through minimizing the negative log-likelihood function using stochastic gradient descent. However, a limitation is the need for periodic boundary conditions, which may lack physical significance. We discuss potential remedies for this limitation. Looking ahead, future research prospects include integrating meerkat location data and environmental information into the model, along with implementing model selection.