Chaotic heteroclinic networks as models of switching behavior in biological systems
Abstract
Key features of biological activity can often be captured by transitions between a finite number of semi-stable states that correspond to behaviors or decisions. We present here a broad class of dynamical systems that are ideal for modeling such activity. The models we propose are chaotic heteroclinic networks with nontrivial intersections of stable and unstable manifolds. Due to the sensitive dependence on initial conditions, transitions between states are seemingly random. Dwell times, exit distributions, and other transition statistics can be built into the model through geometric design and can be controlled by tunable parameters. To test our model’s ability to simulate realistic biological phenomena, we turned to one of the most studied organisms, C. elegans, well known for its limited behavioral states. We reconstructed experimental data from two laboratories, demonstrating the model’s ability to quantitatively reproduce dwell times and transition statistics under a variety of conditions. Stochastic switching between dominant states in complex dynamical systems has been extensively studied and is often modeled as Markov chains. As an alternative, we propose here a new paradigm, namely chaotic heteroclinic networks generated by deterministic rules (without the necessity for noise). Chaotic heteroclinic networks can be used to model systems with arbitrary architecture and size without a commensurate increase in phase dimension. They are highly flexible and able to capture a wide range of transition characteristics that can be adjusted through control parameters.
1 Introduction
Biological systems are invariably highly complex, involving very large numbers of components or substances interacting in complicated ways. Two examples are cortical and metabolic networks. Without major simplification, analytical studies of detailed biological models seem hopelessly out of reach. Not all biological models can be dimension reduced, but when a system has a finite number of dominant states that are semi-stable, phenomenological models focusing on transitions between these states can be constructed and analyzed. One way to reduce to this more tractable situation is to sufficiently constrain the circumstances or scope of study, thereby limiting the set of relevant behaviors. When they exist, dominant states may be identified through empirical observation. They can also be deduced from methods of data-driven modeling such as PCA, HMM, Koopman approximation, or machine learning [9, 23, 46, 2, 18, 44].
This paper is about dynamical models of systems with a finite number of semi-stable “attractor states" around which the system stabilizes briefly before transitioning to another state. We are interested in situations where trajectories are not periodic but seemingly random; which state will occur next has the appearance of being unpredictable, as do transition times. Switching dynamics of this kind have been observed in many biological settings (see Discussion). The attractor states in question typically represent fundamental behaviors or processes [18, 11, 48, 41, 37], and the branching is often associated with decisions. Our motivating examples are primarily from biology, but we consider here general dynamical systems with the characteristics above.
Continuous-time Markov chains (the states of which correspond to the attractor states above) are the simplest natural models that come to mind for describing switching dynamics, but the Markovian assumption is strong. Biological events often have some degree of history dependence. What an animal will do next, for example, may depend on what it did last and how long it has been in its present state. It would be useful to have tractable models that permit a broader set of dynamical behaviors.
We propose that chaotic heteroclinic networks are excellent phenomenological models of switching dynamics. Given a homoclinic loop or heteroclinic cycle, it has been known since the days of Poincaré that transversal intersections of stable and unstable manifolds give rise to complicated behavior[32, 34, 35]. The qualitative picture is clarified by Smale, who showed that this complicated behavior included the existence of horseshoes [42]. Here we take these ideas one step further. We demonstrate that by manipulating the eigenvalues of the saddle fixed points in a heteroclinic network together with the geometry of stable and unstable manifolds and their intersections, one can impose quantitative control on the switching dynamics, including branching probabilities, dwell times, and other more detailed characteristics. These new tools have enabled us to design large classes of chaotic dynamical systems and to tailor transition statistics in heteroclinic networks in order to match observed behavior in biological modeling.
As proof of concept, we constructed chaotic heteroclinic networks to reproduce experimental C. elegans data. C. elegans are a well-studied model organism in biology due to their simple anatomy, simple nervous system, few observed behaviors, and the relative ease of performing experimental measurements of behavioral and neural activity [18, 30, 36, 40, 47]. It has been shown that such activity can be represented in low-dimensional PCA space where semi-stable states correspond to stereotyped behaviors (or fictive behaviors) with characterizable probabilities of transition between these states [18, 31, 24]. C. elegans transition between different behaviors seemingly at random; their tendency to reside in various dynamical and behavioral states can be modified with experimental conditions, such as oxygen levels, genetic strain, and developmental stage [31]. The stochastic switching dynamics of C. elegans, modulated by experimental conditions and corresponding to different locations in neural activity space, is an ideal system to demonstrate how heteroclinic networks can generate stochastic switching behavior observed in biological systems.
Researchers have modeled C. elegans’ activity with a variety of different paradigms. Markov models can accurately capture the observed switching statistics but do not shed light on how transitions are generated [39, 14, 24]; it has also been observed that target states vary with dwell times, pointing to the need for more detailed modeling [31]. Previous dynamical systems models of C. elegans activity used control inputs as the mechanism for inducing state changes [13, 29], but state changes in C. elegans appear to occur mostly spontaneously and not in direct response to external stimuli. The model we propose has the capability to address all of these issues.
Seemingly random switching from one pattern of behavior to another with no apparent trigger is a motif seen throughout biology and neuroscience. We propose that chaotic heteroclinic networks with quantitative control of transition properties may be suitable phenomenological models for this type of behavior.
2 Heteroclinic networks: general theory and quantitative control
This section contains the theory part of the paper. We begin by reviewing some basic ideas connected with heteroclinic dynamics. Then we specialize to 2D, discussing first the case of flows before perturbing their time--maps to produce branching behavior in chaotic heteroclinic networks, the main objects of interest in this paper. This is followed by examples of quantitative control on the switching dynamics, techniques that will be used to build phenomenological models of C. elegan behavior.
Basic definitions
Consider an ordinary differential equation (ODE)
| (1) |
where is an arbitrary integer and is assumed to be smooth. The flow associated with Eq. 1 is denoted by , so that if is the solution of the ODE with initial condition , then is the trajectory of the flow starting from . Let be an equilibrium point of i.e. . We say is a hyperbolic fixed point if none of the eigenvalues of lies on the imaginary axis. If the real parts of are (resp. ) for all , then is a sink (resp. a source); if some are and some are , then is a saddle fixed point. Through each hyperbolic fixed point of saddle type are stable and unstable manifolds, defined to be
| (2) | ||||
| (3) |
respectively. A point is called a homoclinic point of if . If and are distinct hyperbolic fixed points of saddle type, then is a heteroclinic point from to if , i.e., as and as . A point is called a tranverse homoclinic point of if meets transversally at . Transverse heteroclinic points are defined similarly.
In discrete time, i.e., for dynamical systems generated by iterating a map which we assume to be smooth and invertible, the corresponding objects are defined analogously: e.g. a fixed point is called a hyperbolic fixed point of saddle type if the spectrum of is such that and . Stable and unstable manifolds are defined as above with in the place of , and a point is called a heteroclinic point from to .
The existence of transverse homoclinic points is well known to lead to complicated dynamics, an observation that goes back to Poincaré. The qualitative picture is developed by Smale, who showed that homoclinic points are accompanied by the existence of horseshoes, a hallmark of chaos. For a more systematic treatment, see Refs. [32, 33, 26, 16].
Heteroclinic networks for flows in 2D
The continuous-time picture in is simple because for saddle fixed points, and are 1D, and if is a heteroclinic point from to , then the orbit of , , coincides with one of the branches of and one of the branches of . That is, is a saddle connection from to .
A sequence of saddle equilibrium points, , is said to form a heteroclinic cycle if there is a saddle connection from to , . Heteroclinic cycles are prevalent in population dynamics [17, 1] and occur naturally in low codimension bifurcation theory [16]. Fig. 1(a) shows an example of a 3-cycle. Orbits starting from initial conditions sufficiently near in the domain bounded by will shadow the piecewise smooth curve for some time. Additionally, if the heteroclinic cycle is stable, then will be attracted to as , in much the same way that nearby orbits are attracted to limit cycles — except that as increases, the orbit spends a larger and larger fraction of time near the three fixed points.
A sufficient condition for the stability of a heteroclinic cycle connecting saddle fixed points is
| (4) |
where is the eigenvalue in the stable direction of and is the eigenvalue in the unstable direction. Condition (4) implies that compression is greater than expansion at each . This condition can in fact be relaxed to requiring only that the product of the ratios be . See e.g. Refs. [22, 21, 27].
More general than heteroclinic cycles is the idea of a heteroclinic network, loosely defined to be the union of a finite collection of saddle fixed points joined by saddle connections. An example of such a network is shown in Fig. 1(b). For further discussion and examples, see e.g. Refs. [20, 26, 15, 12].
It is easy to see that in a heteroclinic network on , the phase space is divided into cells bounded by heteroclinic cycles. Imposing stability conditions on each cycle as above, the dynamical picture can be described as follows: Each orbit is trapped in a cell; it is attracted to the heteroclinic cycle that bounds the cell, lingering at each one of the saddle fixed points which act as metastable states before moving to the next. The set of metastable states visited depends on initial conditions, but they are visited in a cyclical order without exception. Dwell times at each metastable state, hence the time to complete each cycle, increase without bound as time goes to infinity.
Heteroclinic networks for 2D flows as described above are already models of switching behavior, but the dynamics they describe are very special. In particular, branching cannot occur, and the dynamics are not chaotic.
A number of authors have introduced random noise to heteroclinic networks of the type above to induce branching behavior. Ref. [37], for example, constructs dynamical systems containing such networks to model orbits moving between metastable cognitive states in the brain. Ref. [6] used small noise perturbations near saddle fixed points to model decision making. There is a fair amount of rigorous theory on randomly perturbed heteroclinic networks [3, 5, 4, 7]. We postpone further discussion of these results as our approach is orthogonal: The seemingly random switching behavior in our model comes not from the use of random noise but from chaotic dynamics as we now describe.
Creation of branching behavior: qualitative picture
Chaotic behavior in our model comes from the nontrivial intersection of stable and unstable manifolds in heteroclinic networks. As discussed above, flows in 2D cannot support chaotic dynamics. The lowest phase dimension for which chaotic heteroclinic dynamics can occur is 3D for continuous time and 2D for discrete time. For simplicity, we will work with the latter, though many of the ideas are not confined to two phase dimensions.
Specifically, we start from a flow on with a heteroclinic network, fix a small number , and let be the time--map . It is an easy fact that the saddle fixed points and their stable and unstable manifolds for are identical to those of . We describe below a procedure for modifying along a saddle connection to obtain a smooth map with nontrivial intersection of stable and unstable manifolds. The qualitative ideas behind this procedure are standard in the dynamical systems literature [32], but the quantitative control to follow are, to our knowledge, novel.
Let and be saddle fixed points. We assume there is a heteroclinic orbit of connecting to . For simplicity, we assume, as in Fig. 2(a), that and lie on a horizontal line, while , are vertical lines. For the map , a fundamental domain of on is a segment with the property that the left endpoint of is mapped to the right endpoint under , so that modulo end points and .
Now fix a ball centered at the midpoint of with radius half the length of , and let be such that
where for all , is assumed to lie directly above or below . That is, we perturb into by pushing the images of points in up or down. See Fig. 2(a), where has the shape of a biased sinewave. Since outside of , the -images of for are stretched vertically, compressed horizontally and pressed against as increases.
Let denote the unstable manifold of through (to distinguish it from the corresponding object for ), and let denote the stable manifold of through . Using shorthands such as to refer to the horizontal segment from to , and letting (see Fig. 2(a)), it is easy to check that
Thus, if is nontrivial, meaning if maps some points in above and some points below, then and intersect nontrivially and branching behavior is created: Points in that are mapped to locations above will eventually follow the up-branch of , while those mapped to locations below will follow the down-branch of .
The chaotic behavior or sensitive dependence on initial condition that ensues stems from the fact that for a point near , it is hard to predict whether its trajectory under will follow the up or down-branch of . For strictly to the right of , will be in for some . In the scenario depicted in Fig. 2(a), if it lies on the left two-thirds of , it will follow the up-branch, and if it lies on the right third, it will go down. But even though its future is predetermined, the precise location of is hard to predict when is very closer to and is large. For near and on the right side of , due to the vertical compression and horizontal expansion near , there will be an such that is very closer to . The same reasoning as above then applies, with the precise location of playing a role in the “decision" at .
Examples of quantitative control
Fig. 2(b) elucidates the branching properties that result from the perturbation described in Fig. 2(a). Fixing a disk around , we define dwell time near to be the duration of time a trajectory spends in the disk. Observe that points that are farther from will have shorter dwell times than those closer to . In this example, the distribution of dwell times for trajectories that eventually follow the up- and down-branches are different due to the up-down bias in the map . A histogram showing the heights of for a large collection of points evenly spaced on is also shown. The higher probability to be above (hence to follow the up-branch of is evident, as is the fact that among those above , the center of mass is farther from , resulting in shorter dwell times.
Consider a line segment slightly above : It is easy to see that the height distribution of and dwell times (not shown) will be even more biased than starting from . For higher still, all trajectories will follow the up-branch. A similar analysis can be carried out for all points near .
Two other examples of are shown in Fig. 2(c). The top and bottom panels show transition statistics for trajectories perturbed with a sawtooth perturbation versus a square wave perturbation. (One can approximate these functions with smooth maps without affecting too much the distributions of interest.) The sawtooth distribution results in the heights of being uniformly distributed, whereas the square wave distribution pushes some points far from and leaves others close, resulting in distinct clusters. We illustrate also, in the right panels (c.1-c.4), the effect of the unstable eigenvalues on dwell times. These plots confirm that the shapes of dwell time distributions are determined by the height distributions of as well as the eigenvalues at the saddle fixed point: weaker expansion at pushes points away more slowly, thereby increasing dwell times.
3 Heteroclinic network built to reproduce four-state C. elegans behavioral data
C. elegans, nematodes that grow to about mm in length, are a well-studied model organism in neuroscience [47, 10, 19, 45, 18]. Whole-brain calcium imaging techniques record the activity of most C. elegans’ neurons while real or fictive behavioral states are simultaneously observed [30, 18, 38]. Because their movements are mediated by waves of contractions of bands of muscles that run the full length of the body, C. elegans exhibit only a limited set of behaviors, predominantly forward crawling, turns, reversals, and quiescence [18, 31, 24]. The low-dimensional neural dynamics of C. elegans cluster into different regions in PCA space that correspond to distinct behaviors [31, 18]. Experimentalists have fit Markov models to the behavioral sequences observed, treating transitions between behavioral states as well as the dwell times in each state as stochastic [31, 24]. Variations of behavior patterns in different experimental conditions have also been documented [24, 31].
In the last two sections of this paper we build dynamical systems in the form of chaotic heteroclinic networks (as described in Section II) to simulate C. elegans data. Results reported from two different labs will be used to challenge the model. In this section we focus on results from Ref. [31].
Ref. [31] considered primarily four types of behaviors, abbreviated as forward, reversal, turn, and quiescence. Treating these four behaviors as discrete states, we construct a chaotic heteroclinic network (Fig. 3(a)) containing three saddle fixed points that correspond to the forward, quiescence, and reversal states, and model the “turn" state by a heteroclinic orbit connecting the reversal to the forward fixed point: turns in the data seem always to be preceded by reversal and followed by forward movements. As discussed in Section II, we first build a (nonchaotic) heteroclinc network (in the form of a 2D flow) with the properties above. The chaotic network is obtained by applying perturbations to the flow-map along relevant heteroclinic orbits. Construction details are provided in the Appendix. Dwell times are defined to be time spent in a specified region around each one of the saddle fixed points or a portion of the heteroclinic orbit in the case of turns.
For illustration, we pick one of the modifications of the flow-map, namely the one illustrated in Fig. 3(b), and elaborate on the considerations that went into our choice of the perturbation function, , in the region shown. Experimental data show that following reversal, the turn state occurs with very high probability ( according to the Markov matrix in (d)). Assuming that the quiescence state is not dominant (which is often the case), most orbits arriving at reversal are from the upper branch of the stable manifold where is the fixed point corresponding to reversal. These two facts together suggest that , the function that determines how the upper branch of meets the unstable manifold from the fixed point corresponding to the forward state, should have a strong bias. Accordingly, we have chosen a perturbation that pushes most of the points to the right of and eventually into the turn state. Ref. [31] did not include data on how to constrain the shape of , giving only bias probabilities. In general, the shape of can be deduced from measured dwell time distributions. The shown in Fig. 3(b), e.g., produces a bimodal distribution of displacements (or deviations from ) one step later; see Section II for more detail. Such a distribution (Fig. 3(b)) implies that a large fraction of the trajectories is pushed quite far from and will have shorter dwell time at , while a smaller fraction stays very close to it and will have longer dwell times.
To show how a typical trajectory in the constructed dynamical system may look, we create a behavioral state time series by labeling the system at each point in time with either one of the four identified states or as “in-between", referring to times not in any of the four sets. Transitions between states are assumed to be relatively fast, making the “in-between" category negligible. In the example shown in Fig. 3(c), we have cut out the “in-between" stretches showing only the transition dynamics between the four states.
A target Markov matrix containing transition statistics estimated from experimental data published in Ref. [31] is shown in Fig. 3(d). These statistics were used to guide our model construction. The corresponding statistics collected from our model are shown in Fig. 3(e). Similarity in the matrix entries shows that perturbation functions can be tailored to produce simulated data that closely match the target statistics.
We digress here to point out that unlike Markov models, the dynamical models we propose have the capability to encode memory of past events. The following are two examples to illustrate this flexibility: (1) From the discussion above, we see that most orbits from forward to reversal leave reversal on the outside of the heteroclinic orbit connecting reversal to forward. If we set the strength of the contraction during the time in the turn state to be weak, most orbits will remain on the outside of the loop at forward, making them more likely to switch back to reversal after a short visit to forward. A strong contraction along the heteroclinic orbit will pinch all orbits close to the stable manifold of the fixed point at forward, resulting in less correlation between past and future behaviors. (2) We have prescribed a function, , for how the unstable manifold from forward meets the upper branch of . There is a corresponding function, , to connect the unstable manifold from quiescence to the lower branch of . By choosing and to be different, one can cause dwell times and transition probabilities at reversal to depend on the previous step, i.e., whether the orbit came from forward or quiescence. Similar constructions can lead to dependencies on the steps before.
Another set of results from Ref. [31] that we would like to replicate concerns C. elegans’ transition statistics and dwell times under different experimental conditions: prelethargus vs lethargus, and vs oxygen. The first are developmental stages: It is known that during lethargus periods, C. elegans are more likely to transition to quiescent behavior and to remain in a quiescent state for longer stretches of time with brief periods of activity [31]. Nematodes in the prelethargus stage, in contrast, are much more active. Oxygen levels in the environment are also known to affect activity level: C. elegans in an atmospheric 21% oxygen environment are more likely to remain active than C. elegans in a 10% oxygen environment, which is amenable to sleep. This condition occurs naturally when worms socially aggregate, creating a preferred low oxygen environment [31]. Ref. [31] contains detailed information on dwell times at and transition probabilities from the forward state under different developmental and environmental conditions.
Fig. 4(a) reprints, with permission from AAAS, data from Ref. [31]. Each panel reports on data recorded under a different set of conditions. The heights of the bars in each histogram (ignoring colors for now) show the numbers of transitions out of the forward state within -, - and seconds after entering this state; they can be seen as a probability distribution of dwell times. Each bar in the histogram is further decomposed into a red and a blue portion representing the number of transitions to reversal (red) or quiescence (blue). The red and blue lines superimposed on the histogram indicate the fractions of transitions of these two types. In the middle two columns, we present the corresponding statistics collected from our heteroclinic network.
In the top row we fit transition statistics for C. elegans in a prelethargus state with a oxygen environment. In this developmental stage C. elegans are more active. It is observed experimentally that under these conditions, about half of the transitions out of forward occur in the first seconds. Moreover, when dwell time is sec., the C. elegans are much more likely to switch from forward to reversal; the longer the dwell time in the forward state, the more likely the C. elegans will switch to quiescence. Overall, transitions from forward to reversal are much more prominent than transitions into quiescence, though there is a nonnegligible fraction of the latter due to the low oxygen condition. These data are reproduced in our dynamical systems model using the perturbation function shown in the rightmost panel. Comparing the middle two panels to the left, we see the strong quantitative resemblance of model outputs to experimental data.
Next we compare the top two rows, both of which are for the prelethargus state but at different oxygen levels. Transition statistics are qualitatively similar, except that at oxygen, transition probabilities to quiescence are a little bit lower as high oxygen levels promote activity in C. elegans. Our model is able to capture these relatively subtle distinctions using the perturbations shown.
Differences between the prelethargus and lethargus data (at 10% oxygen) are far more substantial. In contrast to the top row, dwell times in the forward state in the lethargus case (bottom row) are much longer, nearly half of them more than 30 seconds. As before, the longer the time to transition, the more likely it will go into quiescence. This translates into a very significant difference between the prelethargus and lethargus data: In the lethargus case, a good majority of the transitions are to quiescence. Fig. 4 shows excellent agreement between data and model in both cases.
We finish by observing that even though only four types of behaviors are considered, a -state Markov chain is not sufficient for capturing the type of results in Fig. 4; our dynamical model with its tunable parameters offers a simple way to recreate these and other behavioral characteristics.
4 Heteroclinic network built to reproduce eight-state C. elegans behavioral data
In other studies [24, 18], researchers have made more refined classifications of C. elegans behavioral states than those used to fit the model in the previous section. Fig. 5(a) is reproduced from Ref. [24] with permission. It shows a 2D projection (from high dimensional data) of trajectories segmented into states with characteristic dynamics shown in different colors for two different worms. Here the authors distinguished between 8 discrete behavioral states, among them sustained reversals (blue), dorsal and ventral turns (green and yellow), forward crawling (red and crimson) and the transition from forward back to reversal (orange and brown). As part of their study, they proposed an 8-state Markov model, the transition probabilities of which are shown in Fig. 5(c) (reproduced with permission). Our aim in this section is to demonstrate that a chaotic heteroclinic network model can be built to reproduce the more complex picture of C. elegans behavior reported in this paper.
As in the last section, we start by building a 2D flow, representing each of the eight states by either a saddle fixed point or a heteroclinic orbit. Connections between nodes are based on Figure 5(a),(c); a diagram is shown in Figure 5(b). The color code is as in Figure 5(a) and (c); one of the states (purple) appears twice as trajectory segments in that state are found in two distinct sets of circumstances. To keep the dynamics simple, we have opted to capture only the more significant transitions, omitting several that occur with very low probability. Modifications are then made on the time--map of the flow to create nontrivial intersections of stable and unstable manifolds resulting in a chaotic heteroclinic network. The perturbation functions used are chosen with the aim of reproducing the transition probabilities in Figure 5(c).
In addition to transition probabilities, Ref. [24], Fig. 6(b), provides some guidance on the duration of time spent in each state. Though numerical values are not provided, and it is impossible to deduce exact dwell times from these figures, they do offer clues on dwell times. We have incorporated these clues into our dynamical model through the choice of unstable eigenvalues at saddle fixed points and by adjusting the speeds of travel along heteroclinic orbits. By specifying different eigenvalues and perturbation functions for each fixed point, as well as specifying different speeds along the corridors connecting fixed points, we are able to tune the model to replicate both transition statistics and dwell times in the 8-state C. elegans behavioral data.
Model outputs of the resulting dynamical system are collected, and the likelihood of its trajectories visiting state immediately after state is tabulated and shown in Fig. 5(d). Though not perfect, these dynamical transition probabilities — generated by a purely deterministic dynamical system — show good resemblance to the stochastic transition probabilities in Fig. 5(c). Finally, we present in Fig. 5(f) three example trajectories from our dynamical network, in analogy with the three trajectories from Ref. [24] (Fig. 5(e)). The variable itineraries and patterns of transitions in the three trajectories shown exemplify the possibilities and unpredictable outcomes typical in chaotic dynamical systems.
5 Discussion
Stochastic switching in biology. The paradigm of having a finite number of dominant states and switching between them in a seemingly random way in the absence of external stimuli is relevant beyond C. elegans. It has been observed in biological and neural activity in many organisms, and Markov models have been used to capture these behaviors. For example, mice have been found to have different behavioral modules, the switching dynamics between which can be modeled with a hidden Markov model [48]. Larval zebrafish have been observed to transition between discrete behavior states following a Markov model [41]. Fruit fly behavior is known to evolve along a low-dimensional attractor with periodic and nonperiodic behavioral sequences [8]. Other transitions are likely to be caused or facilitated by biological events, but when a mechanistic understanding is out of reach due to high complexities in the underlying biology, many authors have, as a first attempt, idealized such transitions as random. For example, activity in the ventromedial prefrontal cortex (vmPFC) of humans appears to transition stochastically through a series of discrete states that correspond to affective experiences; these state transitions have been modeled with an HMM [11]. The neural activity in the gustatory cortex appears to transition between discrete states stochastically, a fact some researchers have attributed to noise-induced variability [28]. On the phenomenological level, these and many other examples of switching dynamics have a great deal in common with those considered in this paper.
Dynamical vs. stochastic models. Seemingly random switching has been observed in dynamical models. For example, models of spiking neurons are known to support multiple semi-stable states visited by the system in ways that resemble random transitions [25]. It is also known that random switching in (purely deterministic) dynamical systems can be generated by the addition of random noise. Ref. [37], for example, posits that transient cognitive dynamics result from metastable cognitive states which, when linked together, produce stable heteroclinic channels. Sequential decision-making can be modeled with stable heteroclinic channels with noise added to the system. See also Refs. [4, 6, 5]. Differential dwell times near fixed points and random switching between heteroclinic cycles generated by random noise have been studied by a number of authors; see e.g. Refs. [43, 3].
As an alternative to Markov models or dynamical models perturbed by random noise, we propose in this paper the use of chaotic heteroclinic networks to model seemingly random switching behavior. In our heteroclinic network models, dynamical complexity alone — without the need for stochastic manipulations — produces the variability and unpredictable behavior observed. One argument in favor of dynamical models could be that they are more natural, in the sense that physical and biological phenomena are not really stochastic in nature. One could also argue that dynamical systems models are more flexible: In Sections III and IV, we have demonstrated that chaotic heteroclinic networks can be constructed to emulate C. elegans data in two influential papers. Our models accurately reproduce not only basic transition properties between semi-stable states, such as dwell times and branching biases (Figs. 3, 4 and 5), but more subtle behaviors, including exit distributions and dependence of transition probabilities on dwell time (Fig. 4). We have also explained how one could, through network design, influence the degree to which memory of prior events will be retained.
This is not to suggest that stochastic models cannot possess similar capabilities; they can, but the models will have to be somewhat more complicated than -state Markov chains where is the number of behavioral states. We have shown that dynamical models that are relatively easy to construct are capable of recreating a range of behaviors, with excellent quantitative control achieved through tunable parameters. Hence we propose them as a viable alternative to purely stochastic models.
Remarks on global network construction. As discussed, we start by constructing a 2D flow which we perturb to obtain the desired switching behavior. Among the many ways to construct such a flow, we have found the following to be easy to tune and to analyze: First we lay down all the saddle fixed points in , then we connect them with stable and unstable manifolds for the 2D flow. Each stable (unstable) manifold is assumed to comprise a vertical and a horizontal segment with corners rounded (as in Fig. 5(b)). In a neighborhood of this system of “train tracks" of stable and unstable manifolds, we build the vector field to be contractive to trap all nearby orbits. Where stable and unstable manifolds cross in , “overpasses" can be introduced. This geometry does not impose constraints on the architecture of the network.
Extension to a larger class of dynamical models. For clarity of exposition, we have limited ourselves in this paper to heteroclinic networks that are perturbations of time--maps of 2D flows. There are many ways to enlarge this class of models. An obvious extension is to allow higher dimensions, so that the stable and unstable manifolds of the saddle fixed points can have dimension greater than one. In the rest of the Discussion, however, we would like to focus on a different extension, to a broad class of dynamical systems we call generalized heterclinic networks:
Continuing to consider switching behavior among a finite collection of identifiable, semi-stable states, an extension that we think is natural — both from the perspective of modeling and from the dynamical systems theory point of view — is to consider internal dynamics within each of the states in . Specfically, the saddle fixed points in classical heteroclinic networks can be replaced by hyperbolic invariant sets such as hyperbolic periodic orbits, normally hyperbolic invariant tori supporting quasi-periodic behavior, or Smale’s horseshoes [42]. In the case of a periodic cycle, for example, trajectories approaching the cycle will be attracted to it, stay with it for some time, and then veer away after going around the cycle a seemingly random number of times. Stable and unstable manifolds of hyperbolic invariant sets are well defined [32] and their intersections will define the switching dynamics.
Acknowledgments
This work was supported by the National Science Foundation (LSY, grant no. 1901009) as well as the National Science Foundation Mathematical Sciences Postdoctoral Research Fellowship (MM, award no. 2103239). Part of this work was done when LSY held a visiting position at the Institute for Advanced Study.
Data Availability Statement
Appendix: Heteroclinic network construction
We provide here more analytical details on the heteroclinic network construction used in this paper. The methods outlined below are generic and can serve as templates for network constructions elsewhere.
We build a nonlinear dynamical system embedding a heteroclinic network by setting different functions to be dominant in different regions of phase space. By interpolating local dynamics we create a global nonlinear landscape. The global dynamics are
| (5) |
where the local dynamics are weighted by ,
| (6) | ||||
The weighting functions, , weight the dynamics, , highly in each local dynamics’ region of influence, (Fig. 6(a)). The sharpness of the transition between the dynamics in different regions is controlled by hyperbolic tangent slope . In the limit as the system becomes a piecewise function.
We use three types of local functions to construct the heteroclinic network: linear dynamics (Eq. 7), transversal dynamics (Eq. 8), and rotational dynamics (Eq. 9). Stitched together, these three types of dynamics can create flexible heteroclinic networks.
The structure of the producing linear dynamics is
| (7) | ||||
The and axes form the beginning of the stable and unstable manifolds emanating from the fixed point at the origin. The signs of and control which axis is the stable versus unstable manifold; the magnitude of and determine how quickly the system moves toward and away from the fixed point. The location of the fixed point can be shifted to any location .
The structure of the transversal dynamics is
| (8) | ||||
where constants , , and determine the strength of the attracting manifold at and the direction and speed of movement along it. Transversal dynamics can also be constructed to move vertically.
The dynamics for the rotations are easier to represent in polar coordinates and can be expressed as
| (9) | ||||
where constants , , and determine the strength of the attracting radius at and the rotational speed and direction. Polar coordinates can be transformed into Cartesian coordinates and the location of the radius center can be relocated to any .
Figure 6(b) shows the three types of local dynamics which are weighted by weights in order to link the stable and unstable manifolds emanating from fixed points. These building blocks give us great flexibility in creating heteroclinic orbits which comprise the heteroclinic network.
After a continuous time version of the heteroclinic network is constructed (Eq. 5), a discrete mapping in constructed from the continuous dynamics
| (10) |
Perturbations are subsequently applied to the heteroclinic orbits prior to each stable fixed point in this discrete time dynamical system. Perturbation functions perturb the trajectory off of the heteroclinic orbit and take the form
| (11) | ||||
| (12) | ||||
| (13) | ||||
where parameters , , , , , and control the distribution of points that are perturbed above versus below the heteroclinic orbit. These parameters also control the distance from the orbit that these points are displaced. Figure 6(c) shows perturbations with different parameter values that result in more points perturbed above versus below the heteroclinic orbit and close to versus far from the heteroclinic orbit. The width of the perturbation function is scaled to span one timestep of the discrete map and is applied only once preceeding each fixed point. The amplitude of the perturbation is also scaled and affects dwell times. Without perturbations, trajectories would converge to heteroclinic orbits in the network and follow stable manifolds to fixed points, spending longer amounts of time at each subsequent fixed point as trajectories converge closer to the invariant manifolds comprising the heteroclinic orbits. With the use of the perturbation functions, in addition to tuning the parameters for the linear, transversal, and rotational dynamics, dwell time distributions and transition probabilities can be imposed onto the network.
References
- Afraimovich et al. [2010] V. Afraimovich, P. Ashwin, and V. Kirk. Robust heteroclinic and switching dynamics. Dynamical Systems, 25(3):285–286, 2010.
- Alla and Kutz [2017] A. Alla and J. N. Kutz. Nonlinear model order reduction via dynamic mode decomposition. SIAM Journal on Scientific Computing, 39(5):B778–B796, Jan. 2017. ISSN 1064-8275, 1095-7197. doi: 10.1137/16M1059308.
- Armbruster et al. [2003] D. Armbruster, E. Stone, and V. Kirk. Noisy heteroclinic networks. Chaos: An Interdisciplinary Journal of Nonlinear Science, 13(1):10, 2003.
- Bakhtin [2010] Y. Bakhtin. Small noise limit for diffusions near heteroclinic networks. Dynamical Systems, 25(3):413–431, Sept. 2010. ISSN 1468-9367. doi: 10.1080/14689367.2010.482520.
- Bakhtin [2011] Y. Bakhtin. Noisy heteroclinic networks. Probability Theory and Related Fields, 150(1-2):1–42, June 2011. ISSN 0178-8051, 1432-2064. doi: 10.1007/s00440-010-0264-0.
- Bakhtin and Correll [2012] Y. Bakhtin and J. Correll. A neural computation model for decision-making times. Journal of Mathematical Psychology, 56(5):333–340, Oct. 2012. ISSN 00222496. doi: 10.1016/j.jmp.2012.05.005.
- Bakhtin et al. [2022] Y. Bakhtin, H.-B. Chen, and Z. Pajor-Gyulai. Rare transitions in noisy heteroclinic networks, Apr. 2022.
- Berman et al. [2014] G. J. Berman, D. M. Choi, W. Bialek, and J. W. Shaevitz. Mapping the stereotyped behaviour of freely moving fruit flies. Journal of The Royal Society Interface, 11(99):20140672, Oct. 2014. doi: 10.1098/rsif.2014.0672.
- Brunton and Kutz [2019] S. L. Brunton and J. N. Kutz. Data-Driven Science and Engineering: Machine Learning, Dynamical Systems, and Control. Cambridge University Press, Cambridge, United Kingdom; New York, NY, 2019. ISBN 978-1-108-42209-3.
- Chalasani et al. [2007] S. H. Chalasani, N. Chronis, M. Tsunozaki, J. M. Gray, D. Ramot, M. B. Goodman, and C. I. Bargmann. Dissecting a circuit for olfactory behaviour in Caenorhabditis elegans. Nature, 450(7166):63–70, Nov. 2007. ISSN 1476-4687. doi: 10.1038/nature06292.
- Chang et al. [2021] L. J. Chang, E. Jolly, J. H. Cheong, K. M. Rapuano, N. Greenstein, P.-H. A. Chen, and J. R. Manning. Endogenous variation in ventromedial prefrontal cortex state dynamics during naturalistic viewing reflects affective experience. Science Advances, Apr. 2021. doi: 10.1126/sciadv.abf7129.
- Field and Swift [1991] M. Field and J. W. Swift. Stationary bifurcation to limit cycles and heteroclinic cycles. Nonlinearity, 4(4):1001–1043, Nov. 1991. ISSN 0951-7715, 1361-6544. doi: 10.1088/0951-7715/4/4/001.
- Fieseler et al. [2020] C. Fieseler, M. Zimmer, and J. N. Kutz. Unsupervised learning of control signals and their encodings in Caenorhabditis elegans whole-brain recordings. Journal of The Royal Society Interface, 17(173):20200459, Dec. 2020. doi: 10.1098/rsif.2020.0459.
- Gallagher et al. [2013] T. Gallagher, T. Bjorness, R. Greene, Y.-J. You, and L. Avery. The geometry of locomotive behavioral states in C. elegans. PLOS ONE, 8(3):e59865, Mar. 2013. ISSN 1932-6203. doi: 10.1371/journal.pone.0059865.
- Guckenheimer and Holmes [1988] J. Guckenheimer and P. Holmes. Structurally stable heteroclinic cycles. Mathematical Proceedings of the Cambridge Philosophical Society, 103(1):189–192, Jan. 1988. ISSN 1469-8064, 0305-0041. doi: 10.1017/S0305004100064732.
- Guckenheimer and Holmes [2013] J. Guckenheimer and P. Holmes. Nonlinear Oscillations, Dynamical Systems, and Bifurcations of Vector Fields, volume 42. Springer Science & Business Media, 2013.
- Hofbauer et al. [1998] J. Hofbauer, K. Sigmund, et al. Evolutionary Games and Population Dynamics. Cambridge university press, 1998.
- Kato et al. [2015] S. Kato, H. S. Kaplan, T. Schrödel, S. Skora, T. H. Lindsay, E. Yemini, S. Lockery, and M. Zimmer. Global brain dynamics embed the motor command sequence of Caenorhabditis elegans. Cell, 163(3):656–669, Oct. 2015. ISSN 00928674. doi: 10.1016/j.cell.2015.09.034.
- Kimata et al. [2012] T. Kimata, H. Sasakura, N. Ohnishi, N. Nishio, and I. Mori. Thermotaxis of C. elegans as a model for temperature perception, neural information processing and neural plasticity. Worm, 1(1):31–41, Jan. 2012. ISSN null. doi: 10.4161/worm.19504.
- Kirk and Silber [1994] V. Kirk and M. Silber. A competition between heteroclinic cycles. Nonlinearity, 7(6):1605–1621, Nov. 1994. ISSN 0951-7715, 1361-6544. doi: 10.1088/0951-7715/7/6/005.
- Krupa [1997] M. Krupa. Robust heteroclinic cycles. Journal of Nonlinear Science, 7(2):129–176, Apr. 1997. ISSN 1432-1467. doi: 10.1007/BF02677976.
- Krupa and Melbourne [1995] M. Krupa and I. Melbourne. Asymptotic stability of heteroclinic cycles in systems with symmetry. Ergodic Theory and Dynamical Systems, 15(1):121–147, Feb. 1995. ISSN 1469-4417, 0143-3857. doi: 10.1017/S0143385700008270.
- Kutz et al. [2016] J. N. Kutz, S. L. Brunton, B. W. Brunton, and J. L. Proctor. Dynamic Mode Decomposition: Data-Driven Modeling of Complex Systems. SIAM, 2016.
- Linderman et al. [2019] S. Linderman, A. Nichols, D. Blei, M. Zimmer, and L. Paninski. Hierarchical recurrent state space models reveal discrete and continuous dynamics of neural activity in C. elegans, Apr. 2019.
- Mazzucato et al. [2015] L. Mazzucato, A. Fontanini, and G. L. Camera. Dynamics of multistable states during ongoing and evoked cortical activity. Journal of Neuroscience, 35(21):8214–8231, May 2015. ISSN 0270-6474, 1529-2401. doi: 10.1523/JNEUROSCI.4819-14.2015.
- Meiss [2007] J. D. Meiss. Differential Dynamical Systems. SIAM, 2007.
- Melbourne et al. [1989] I. Melbourne, P. Chossat, and M. Golubitsky. Heteroclinic cycles involving periodic solutions in mode interactions with O(2) symmetry. Proceedings of the Royal Society of Edinburgh: Section A Mathematics, 113(3-4):315–345, 1989. ISSN 0308-2105, 1473-7124. doi: 10.1017/S0308210500024173.
- Miller and Katz [2010] P. Miller and D. B. Katz. Stochastic transitions between neural states in taste processing and decision-making. Journal of Neuroscience, 30(7):2559–2570, Feb. 2010. ISSN 0270-6474, 1529-2401. doi: 10.1523/JNEUROSCI.3047-09.2010.
- Morrison et al. [2021] M. Morrison, C. Fieseler, and J. N. Kutz. Nonlinear control in the nematode C. elegans. Frontiers in Computational Neuroscience, 14, 2021. ISSN 1662-5188.
- Nguyen et al. [2016] J. P. Nguyen, F. B. Shipley, A. N. Linder, G. S. Plummer, M. Liu, S. U. Setru, J. W. Shaevitz, and A. M. Leifer. Whole-brain calcium imaging with cellular resolution in freely behaving Caenorhabditis elegans. Proceedings of the National Academy of Sciences, 113(8):E1074–E1081, Feb. 2016. ISSN 0027-8424, 1091-6490. doi: 10.1073/pnas.1507110112.
- Nichols et al. [2017] A. L. A. Nichols, T. Eichler, R. Latham, and M. Zimmer. A global brain state underlies C. elegans sleep behavior. Science, 356(6344), June 2017. ISSN 0036-8075, 1095-9203. doi: 10.1126/science.aam6851.
- Palis et al. [1995] J. Palis, J. P. Júnior, and F. Takens. Hyperbolicity and Sensitive Chaotic Dynamics at Homoclinic Bifurcations: Fractal Dimensions and Infinitely Many Attractors in Dynamics. Cambridge University Press, Jan. 1995. ISBN 978-0-521-47572-3.
- Palis and De Melo [2012] J. J. Palis and W. De Melo. Geometric Theory of Dynamical Systems: An Introduction. Springer Science & Business Media, 2012.
- Poincaré [1890] H. Poincaré. Sur le problème des trois corps et les équations de la dynamique. Acta mathematica, 13(1):A3–A270, 1890.
- Poincaré [1899] H. Poincaré. Les Méthodes Nouvelles de La Mécanique Céleste, volume 3. Gauthier-Villars et fils, 1899.
- Prevedel et al. [2014] R. Prevedel, Y.-G. Yoon, M. Hoffmann, N. Pak, G. Wetzstein, S. Kato, T. Schrödel, R. Raskar, M. Zimmer, E. S. Boyden, and A. Vaziri. Simultaneous whole-animal 3D imaging of neuronal activity using light-field microscopy. Nature Methods, 11(7):727–730, July 2014. ISSN 1548-7091, 1548-7105. doi: 10.1038/nmeth.2964.
- Rabinovich et al. [2008] M. I. Rabinovich, R. Huerta, P. Varona, and V. S. Afraimovich. Transient cognitive dynamics, metastability, and decision making. PLOS Computational Biology, 4(5):e1000072, May 2008. ISSN 1553-7358. doi: 10.1371/journal.pcbi.1000072.
- Randi and Leifer [2020] F. Randi and A. M. Leifer. Measuring and modeling whole-brain neural dynamics in Caenorhabditis elegans. Current Opinion in Neurobiology, 65:167–175, Dec. 2020. ISSN 0959-4388. doi: 10.1016/j.conb.2020.11.001.
- Roberts et al. [2016] W. M. Roberts, S. B. Augustine, K. J. Lawton, T. H. Lindsay, T. R. Thiele, E. J. Izquierdo, S. Faumont, R. A. Lindsay, M. C. Britton, N. Pokala, C. I. Bargmann, and S. R. Lockery. A stochastic neuronal model predicts random search behaviors at multiple spatial scales in C. elegans. eLife, 5:e12572, Jan. 2016. ISSN 2050-084X. doi: 10.7554/eLife.12572.
- Schrödel et al. [2013] T. Schrödel, R. Prevedel, K. Aumayr, M. Zimmer, and A. Vaziri. Brain-wide 3D imaging of neuronal activity in Caenorhabditis elegans with sculpted light. Nature Methods, 10(10):1013–1020, Oct. 2013. ISSN 1548-7091, 1548-7105. doi: 10.1038/nmeth.2637.
- Sharma et al. [2018] A. Sharma, R. Johnson, F. Engert, and S. Linderman. Point process latent variable models of larval zebrafish behavior. In Advances in Neural Information Processing Systems, volume 31. Curran Associates, Inc., 2018.
- Smale [1967] S. Smale. Differentiable dynamical systems. Bulletin of the American Mathematical Society, 73(6):747–817, 1967. ISSN 0002-9904, 1936-881X. doi: 10.1090/S0002-9904-1967-11798-1.
- Stone and Holmes [1990] E. Stone and P. Holmes. Random perturbations of heteroclinic attractors. SIAM Journal on Applied Mathematics, 50(3):726–743, June 1990. ISSN 0036-1399, 1095-712X. doi: 10.1137/0150043.
- Taghia et al. [2018] J. Taghia, W. Cai, S. Ryali, J. Kochalka, J. Nicholas, T. Chen, and V. Menon. Uncovering hidden brain state dynamics that regulate performance and decision-making during cognition. Nature Communications, 9(1):2505, Dec. 2018. ISSN 2041-1723. doi: 10.1038/s41467-018-04723-6.
- Varshney et al. [2011] L. R. Varshney, B. L. Chen, E. Paniagua, D. H. Hall, and D. B. Chklovskii. Structural properties of the Caenorhabditis elegans neuronal network. PLOS Computational Biology, 7(2):e1001066, Feb. 2011. ISSN 1553-7358. doi: 10.1371/journal.pcbi.1001066.
- Westhead and Vijayabaskar [2017] D. R. Westhead and M. S. Vijayabaskar, editors. Hidden Markov Models: Methods and Protocols, volume 1552 of Methods in Molecular Biology. Springer New York, New York, NY, 2017. ISBN 978-1-4939-6751-3 978-1-4939-6753-7. doi: 10.1007/978-1-4939-6753-7.
- White et al. [1986] J. G. White, E. Southgate, J. N. Thomson, and S. Brenner. The structure of the nervous system of the nematode Caenorhabditis elegans. Philosophical Transactions of the Royal Society of London. Series B, Biological Sciences, 314(1165):1–340, Nov. 1986. ISSN 0962-8436. doi: 10.1098/rstb.1986.0056.
- Wiltschko et al. [2015] A. B. Wiltschko, M. J. Johnson, G. Iurilli, R. E. Peterson, J. M. Katon, S. L. Pashkovski, V. E. Abraira, R. P. Adams, and S. R. Datta. Mapping sub-second structure in mouse behavior. Neuron, 88(6):1121–1135, Dec. 2015. ISSN 0896-6273. doi: 10.1016/j.neuron.2015.11.031.