Mode switching in organisms for solving explore-versus-exploit problems

Trade-offs between producing costly movements for gathering information (‘explore’) and using previously acquired information to achieve a goal (‘exploit’) arise in a wide variety of problems, including foraging, reinforcement learning and sensorimotor control. Determining the optimal balance between exploration and exploitation is computationally intractable, necessitating heuristic solutions. Here we show that the electric fish Eigenmannia virescens uses a salience-dependent mode-switching strategy to solve the explore–exploit conflict during a refuge-tracking task in which the same category of movement (fore-aft swimming) is used for both gathering information and achieving task goals. The fish produced distinctive non-Gaussian distributions of movement velocities characterized by sharp peaks for slower, task-oriented ‘exploit’ movements and broad shoulders for faster ‘explore’ movements. The measures of non-normality increased with increased sensory salience, corresponding to a decrease in the prevalence of fast explore movements. We found the same sensory salience-dependent mode-switching behaviour across ten phylogenetically diverse organisms, from amoebae to humans, performing tasks such as postural balance and target tracking. We propose a state-uncertainty-based mode-switching heuristic that reproduces the distinctive velocity distribution, rationalizes modulation by sensory salience and outperforms the classic persistent excitation approach while using less energy. This mode-switching heuristic provides insights into purposeful exploratory behaviours in organisms, as well as a framework for more efficient state estimation and control of robots. Organisms show complex behaviour resulting from a trade-off between obtaining information (explore) and using current information (exploit). Biswas et al. observe a mode-switching strategy modulated by sensory salience in a diverse range of organisms, including electric fish and humans, and argue that the observed heuristic could inform the design of active-sensing behaviours in robotics.

Trade-offs between producing costly movements for gathering information ('explore') and using previously acquired information to achieve a goal ('exploit') arise in a wide variety of problems, including foraging, reinforcement learning and sensorimotor control.Determining the optimal balance between exploration and exploitation is computationally intractable, necessitating heuristic solutions.Here we show that the electric fish Eigenmannia virescens uses a salience-dependent mode-switching strategy to solve the explore-exploit conflict during a refuge-tracking task in which the same category of movement (fore-aft swimming) is used for both gathering information and achieving task goals.The fish produced distinctive non-Gaussian distributions of movement velocities characterized by sharp peaks for slower, task-oriented 'exploit' movements and broad shoulders for faster 'explore' movements.The measures of non-normality increased with increased sensory salience, corresponding to a decrease in the prevalence of fast explore movements.We found the same sensory salience-dependent mode-switching behaviour across ten phylogenetically diverse organisms, from amoebae to humans, performing tasks such as postural balance and target tracking.We propose a state-uncertainty-based mode-switching heuristic that reproduces the distinctive velocity distribution, rationalizes modulation by sensory salience and outperforms the classic persistent excitation approach while using less energy.This mode-switching heuristic provides insights into purposeful exploratory behaviours in organisms, as well as a framework for more efficient state estimation and control of robots.
Organisms show complex patterns of movement that arise from the interplay between obtaining information ('explore') [1][2][3] and using current information ('exploit') 4 .Exploratory movements to gain information and exploitative movements to achieve the task at hand are often mediated by the same motor systems.For example, the weakly electric glass knifefish (Eigenmannia virescens) produces both information-seeking exploratory movements 2,3,5 and goal-driven exploitative movements to remain within a refuge 6,7 using the same ribbon-fin locomotor system 8,9 .Both of these types of movement occur in a single linear dimension, along the rostrocaudal axis.This behaviour makes E. virescens an excellent model system with which to investigate the interplay between explore and exploit movements: within a fixed refuge, fish produce Article https://doi.org/10.1038/s42256-023-00745-yrequires only small corrective movements; therefore, any significant movements by the fish are attributed to information-seeking, exploratory movement 2,3,5 .Previous work 23 has demonstrated that E. virescens use both vision and electrosense for station keeping.Hence varying the light level is an experimental mechanism to examine the effect of visual salience on the selection between explore and exploit movements.
We measured the movements of five individual fish in 40 s duration station-keeping trials, in two lighting conditions: lights 'off' trials had low illumination (~0.3 lx; Supplementary Video 1) and lights 'on' trials had bright illumination (~80 lx; Supplementary Video 2).We conducted between seven and ten trials per condition per fish.We discarded trials in which the fish changed its swimming direction or exited the refuge.Consistent with previous studies 2,5 , fish moved significantly more in lights-off conditions than in lights-on conditions (Fig. 1c,d and Extended Data Fig. 1a-d).However, these previous analyses 2,5 focused on tracking performance using analytical methods including Fourier analysis and root-mean-square (RMS) metrics that masked the temporal structure of the active-sensing movements that we seek to understand in this paper.
We found the patterns of fish swimming velocities were consistent with a mode-switching strategy.The distribution of velocities (v) featured a sharp peak around v = 0 with 'broad' shoulders for faster movements (Fig. 1e,f, right).These empirical distributions differed from a Gaussian distribution in two ways: (1) the distinct central peak and (2) the broad shoulders corresponding to the faster movements.The central peak (near-zero velocity) represents slow movement and the broad shoulders represent faster movement.These behavioural modes are associated with exploit and explore, respectively, as discussed in greater detail below.
The two behavioural modes were significantly better approximated by three-component Gaussian mixture models (GMMs) than by single-component models (Fig. 1e,f, right).This was shown by three measures, namely Kullback-Leibler divergence, Bayesian information criterion and closeness of quantile-quantile plots to the reference line (Extended Data Table 1, Extended Data Fig. 1e,f and Supplementary Fig. 1).The three-component GMMs generally comprised a sharp central Gaussian peak, capturing slow, task-oriented station-keeping movements, and two Gaussian 'shoulders', capturing faster, positive (forwards) and negative (backwards) exploratory movements.We found ancillary back-and-forth exploratory movements to sense the refuge 2,3,5 , but these back-and-forth (explore) movements conflict with the corrective movements (exploit) required for station keeping.
Resolving this conflict between explore movements 5 versus goal-directed exploit movements is a computationally intractable optimization problem [10][11][12] .How do organisms resolve the explore-exploit conflict?A simple heuristic to solve this problem would be for an organism to perform goal-directed exploit movements while superimposing continuous small exploratory sensing movements-in other words, to use a persistent excitation approach 13 .Indeed, this heuristic has proven effective (if suboptimal) as an engineering approach to solve the exploreexploit problem of identifying states and parameters of a dynamical system during task execution 13 .If organisms were to employ such a strategy, they would produce movement statistics that correspond to a single behavioural mode (for example, a single-component Gaussian distribution) that continuously superimposes explore and exploit behaviour.
In contrast, we discovered that E. virescens does not use a persistent excitation strategy; instead, it shows a mode-switching strategy between fast, active-sensing movements (explore) and slow, corrective movements (exploit).This mode switching is modulated by sensory salience (Fig. 1 and 2).To assess the generality of this mode-switching strategy we investigated ten additional tasks performed by ten species ranging from amoebae to humans [14][15][16][17][18][19][20][21][22] , using five major sensing modalities-vision, audition, olfaction, tactile sensing and electrosensation (Fig. 3).On the basis of this extensive reanalysis, we found that such mode switchingand its dependence on sensory salience-is found across diverse behaviours, taxa and sensing modalities (Fig. 4).Inspired by this widespread biological strategy, we propose an engineering heuristic for selecting behavioural modes based on state uncertainty (Fig. 5), and show that this heuristic captures key features of mode switching found across organismal models.Furthermore, we show that this mode-switching heuristic can achieve better task-level performance, and do so with less control effort, than the conventional persistent-excitation strategy.

E. virescens exhibited fast and slow behavioural modes
We examined the behaviour of individual E. virescens as they performed untrained station keeping within a fixed refuge (Fig. 1a,b).Station keeping

Article
https://doi.org/10.1038/s42256-023-00745-y that only modest improvements in the fit of the GMMs occurred when using more than three components (Extended Data Fig. 1g).
The fast-mode movements increased in frequency in lights-off trials, increasing the relative prominence of the 'shoulders'.For example, Fig. 1e,f shows representative data from one fish in which there were 48 fast movements with lights off (Fig. 1e, left) but only 13 fast movements with lights on (Fig. 1f, left).Interestingly, the overall higher proportion of fast velocities in lights-off trials leads to a surprising result, namely, higher kurtosis values for lights-on versus lights-off trials (Extended Data Fig. 1h).In other words, the increase in frequency of fast motions in the dark leads to a decrease in the relative prominence of the central, task-oriented velocity peak at v = 0, so that the overall distribution is closer to Gaussian and the kurtosis trends towards 3.
We found that the trend towards a Gaussian distribution of movement velocities in lights-off trials (reduced sensory salience) to be surprising because the exploratory movements for actively sensing the environment are associated with a nonlinear requirement 24,25 to make movements that are potentially in conflict with task goals.Therefore, our initial hypothesis-that this nonlinearity would produce increased deviation from a Gaussian velocity distribution as sensory salience was reduced-was not supported.Our initial intuition failed because we did not appreciate that decreases in sensory salience drives the selection of explore behaviour, and that behaviour itself is approximately Gaussian, ultimately reducing the relative prominence of the task-oriented central peak.
Interestingly, reanalysis of data from a previous study of exploratory movements in a similar refuge-tracking paradigm in E. virescens show the same relationship between sensory salience and changes in velocity profiles, but for modulations of a different sensory modality, namely, electrosensation 3 .In these previous experiments, artificially generated electrical signals were used to diminish the salience of electrosensory information as the electric fish performed the refuge tracking.Our reanalysis of these published data (see Supplementary Material and Methods for details) showed that fish exhibited the distinctive non-Gaussian distribution of velocities.Moreover, the velocity distributions were modulated in relation to electrosensory salience: lower kurtosis values (corresponding to more normal distributions) occurred in experimental trials with added artificial electrosensory 'jamming' signals (Extended Data Fig. 2a-f).

Sensory salience drives explore-exploit mode switching
How do changes in sensory salience drive changes in mode switching?To investigate this question, we segregated the velocity trajectories Fig. 2 | Bursts of faster movements are more common in lights-off trials than in lights-on trials.a,b, Fish showed two distinct behavioural modes, slow movement and fast movement, as seen in the velocity (top) and position traces (bottom) of representative trials from the same fish under lights-off (a) and lights-on (b) conditions.c, The residence time in the slow mode, computed as the percent of the trial duration (40 s), was significantly higher during lights-on trials than lights-off trials (one-sided P values are 0.0002, 0.0001, 0.0001, 0.0014 and 0.0001, respectively).d, The switching between the fast mode (positive and negative combined) and slow mode was significantly more frequent in lights-off trials (black) than in lights-on trials (red) (one-sided P values are 0.0037, 0.0070, 0.0008, 0.0045 and 0.0001, respectively).All box-and-whisker plots include the median line, the box denotes the interquartile range (IQR), whiskers denote the rest of the data distribution and outliers are denoted by points greater than ±1.5 × IQR.For both c and d, the P values were calculated using the Mann-Whitney-Wilcoxon test.The total number of lights-off trials (n) for fish 1 and 3 was 7, and for the rest it was 10 trials per condition per fish.
Fish produced slow-and fast-velocity modes of movements in both lights-on and lights-off trials.We computed the residence time in each behavioural mode as a proportion of the total time spent in that mode compared with the trial duration of 40 s (note that the residence time in slow and fast modes adds up to unity).The residence time τ s in the slow exploit mode was significantly higher (>1.7 times) in lights-on trials than the lights-off trials (Fig. 2c).In contrast, the residence time in the fast explore mode (1 − τ s ) was higher in light-off than in lights-on trials.
Fish switched between slow and fast modes more frequently in lights-off trials than in lights-on trials (Fig. 2d).From the computation of the transition rates between slow (S) and fast (F) modes as a two-state Markov process, we found that the transition rate S → F was significantly lower in lights-on versus lights-off trials, that is, the slow (exploit) state was visited more frequently in the lights-on trials compared with lights-off trials (Extended Data Fig. 3b).This salience-dependent modulation of switching frequency was the key mechanism by which movement velocity distributions trended towards a Gaussian distribution as a function of decreased sensory salience.

Mode-switching across taxa, behaviours and sensory modalities
Is this mode-switching strategy solution for the explore-versus-exploit problem found in other species, in other categories of behavioural tasks and in control systems that rely on other sensing modalities?
To answer this question, we analysed published data for an additional ten species, representing a wide phylogenetic range of taxa, from single-celled organisms to humans, involving categorically different tasks and sensorimotor regimes 3,[14][15][16][17][18][19][20]22 . Thee taxonomically diverse species were selected to encompass a wide range of behaviours that rely on a broad range of sensory systems (Fig. 3).For every example we examined, we found the same distinctive non-normal distribution of velocities, with a peak at low-velocity movements and broad shoulders for higher-velocity movements (Fig. 4).
For example, postural sway movements in humans are thought to prevent the fading of postural state information during balance 26 .Our reanalysis of quiescent stance data 17 revealed evidence of mode switching (Fig. 4a) that is remarkably similar to our findings in electric fish.In the quiescent stance task, human participants used visual and tactile feedback to maintain an upright posture.The distribution of sway velocities revealed a distinct peak at low velocities corresponding to the task goal, and broad shoulders for higher velocities produced by the exploratory movements; the velocity statistics were better captured by a GMM than a normal distribution.Furthermore, the velocity distribution showed the same surprising relation to changes in salience, becoming more Gaussian as well as an increase in the switching frequency when sensory salience was decreased (Extended Data Fig. 4a-d), as seen in the electric fish E. virescens.
Mode switching was also observed in invertebrate species.For example, the Carolina sphinx hawkmoth (Manduca sexta) uses somatosensory feedback from their proboscis to detect the curvature of flowers when searching for nectaries at dawn and dusk 20 .In this search behaviour, which has dynamics that are qualitatively similar to vibrissal sensing in rats 27 , the moth sweeps its proboscis across the surface of the flower using a combination of slow-and high-velocity movements.Our analysis of the distribution of the rate of change of radial orientation angle (angle between the proboscis tip trajectory and the radial axis of the flower), before the insertion of the proboscis tip into the nectary shows the characteristic sharp peak with broad shoulders (Fig. 4g) that is captured by a GMM.Experimental changes in the shape of artificial flowers that degrade the salience of the curvature of the flower surface 20 resulted in a decrease of the kurtosis value of the proboscis angular velocity distribution (Extended Data Fig. 5a-f), similar to how both E. virescens and humans responded to changes in sensory salience.
The fact that this salience-based, mode-switching strategy was found in two distantly related classes (mammalia and insecta) The major sensing modalities (vision, tactile sensing, audition, olfaction and eletrosensation) used for task execution are listed next to the organisms (four species of mammals, a species of ray-finned fish, four species of insects and two species of amoebae).The effect of sensory salience is studied for organisms marked with a star.Behaviours and movement statistics of the organisms are shown in greater detail in Fig. 4.

Article
https://doi.org/10.1038/s42256-023-00745-yperforming very different behaviours, using different sensorimotor systems, suggests that the strategy emerged as a convergent solution to the explore-versus-exploit problem.We found additional evidence of convergence of this solution in reanalysis of eight additional datasets: visual saccades in humans (Fig. 4b and Supplementary Fig. 3) 21 and in house mice Mus musculus (Fig. 3c and Supplementary Fig. 4) 15 , movements of the pinnae of echolocating big brown bats Eptesicus fuscus (Fig. 4d and Supplementary Fig. 5) 16 , olfaction in eastern moles Scalopus aquaticus (Fig. 4e and Supplementary Fig. 6) 14 and American cockroaches Periplaneta americana (Fig. 4f and Extended Data Fig. 4e-f) 18 , and visual tracking of a swaying flower in three species of hawkmoths (M.sexta, Deilephila elpenor and Macroglossum stellatarum; Fig. 4h and Extended Data Fig. 5g-p) 19 .The discovery of a similar, parsimonious velocity distributions across taxa, behaviour and sensing modalities, with consistent dependency on sensory salience, was surprising.
Intriguingly, our analysis of the dynamics of transverse exploration by pseudopods of amoebae 22 (Amoeba proteus and Metamoeba leningradensis) reveals similar GMM velocity distributions in response to an electric field (Extended Data Fig. 6).Although our modelling approach (see next section) includes inertial dynamics, which cannot be directly applied to movement of organisms in the low-Reynolds-number regimes occupied by single-celled and other microscopic organisms, these observations are consistent with a mode-switching strategy for the control of movement in these amoebae.
The examples described above include a broad phylogenetic array of organisms that perform a variety of behavioural tasks using different control and morphophysiological systems.Just as these behavioural systems evolved within each of the lineages represented in our reanalyses, we suggest that mode switching probably evolved independently in each lineage as well.In other words, the similarities we found across taxa are the result of convergent evolution towards a common solution-mode switching-for the explore-versus-exploit problem.

Heuristic model of the mode-switching strategy
Why might animals use mode switching, rather than the simpler heuristic of applying continual, low-amplitude exploratory inputs used by control engineers 13 ?To address this question, we propose a parsimonious heuristic model that comprises a nonlinear motion-dependent sensor, a linear musculoskeletal plant, a state estimator (also known as an observer 28 ) and a mode-switching controller (Fig. 5a).For the musculoskeletal plant, we assumed a simplified second-order Newtonian model 9,24 : Here  17 .b, Microsaccades in humans (H.sapiens) during fixated gaze 21 .c, Bilateral eye movements in mice (M.musculus) during prey (cricket) capture 15 .d, Pinnae movements in big brown bats (E.fuscus) while echolocating prey (mealworm) 16 .e, Olfactory-driven head movements in eastern moles (S. aquaticus) in response to food (earthworms) 14 .f, Odour plume tracking in American cockroaches (P.americana) in response to sex pheromone (periplanone B) 18 .g, Tactile sensing by Carolina sphinx hawkmoth (M.sexta) while searching for a flower nectary 20 .h, Visual tracking of swaying flower by hawkmoths 19 (three species; only data from elephant hawkmoth, D. elpenor is shown; for the remainder, see Extended Data Fig. 5g-p).The second column shows representative temporal traces of the active exploratory movements and the third column shows the respective velocity traces.The fourth column presents velocity histograms showing that, unlike the normal distribution (magenta dashed curve), the three-component GMM (blue solid curve) captures the broad-shouldered nature of the velocity data across species, behaviours and sensing modalities.See Supplementary Materials and Methods for detailed method and Extended Data Table 2 for  Article https://doi.org/10.1038/s42256-023-00745-ynoise.The process noise includes noise due to physical disturbances 29,30 as well as motor noise 31 .The system parameters m and b represent unitless mass and viscous damping, respectively.
The key feature of the model is that the nonlinear sensory system (that is, the 'motion-dependent sensor') embodies the high-pass filtering (that is, fading or adapting) characteristics found across biological sensory systems 26,[32][33][34][35][36][37][38] .This sensory system model ('motion-dependent sensor' in Fig. 5a) assumes nonlinear measurements that decay to zero over time in the face of constant stimuli: Here s(x) is the position-dependent sensory stimulus experienced by the organism, g(x) is the spatial derivative of the sensory stimulus (ds(x)/dx), and w 2 (t) is the sensory noise.The controller includes a state-feedback-based task-level control policy, −f( x, v), which exploits previously collected sensory information; that information is parsimoniously encoded (1) in estimates of the position and velocity ( x, v), and (2) in an ongoing measure of uncertainty, M (based on the covariance of position and velocity estimates; see Methods).Previous theoretical work has demonstrated that exploratory movements are required for state estimation in control systems that rely on such high-pass (that is, fading) sensors 24,25 .Hence, the controller also includes an active-sensing control policy, u a (t), that seeks to gain new information through exploratory movements.
To find the optimal balance between exploit and explore components, for a given admissible control policy, π and a given weight, r for an input, u ∈  (action space), we can define the average steady-state cost function: where  is the expectation computed over all the trajectories induced by admissible control policy, π.Note that a control policy is admissible if it depends causally on the sensor and actuator data.We chose the cost function, J π as a weighted combination of steady-state tracking error and control effort.Even with complete knowledge of the system states, computation of the optimal solution J π * = inf π∈Π J π where Π is the set of all admissible control policies, is only tractable in the case of linear systems or systems with finite state and action spaces. 39.As the system is partially observed, existing approaches to optimal control require the solution to an optimal filtering problem and then formulate feedback laws on the filter states 39 .The filtering problem requires computation of the conditional probability ℙ ([ However, due to nonlinearity in the measurement (equation ( 2)), there is no tractable method to compute this conditional probability, and so heuristic strategies are required.We tested three exploratory movement heuristics for the controller to find an approximate answer to this intractable optimal control problem.
(1) Zero excitation: this is a passive strategy (that is, no exploration) in which the system provides no input excitation for the actuation forces (u a (t) = 0 for all t).This is a conventional state-feedback controller.(2) Persistent excitation: this scheme tests a common continuous exploration strategy used in the field of adaptive control 13 .The controller continually injects a Gaussian input u a (t).(3) Triggered excitation: this mode-switching strategy depends on lower and upper thresholds, T min and T max ; the controller injects Gaussian input only when the uncertainty in the state estimator M exceeds T max , and then continues to inject input until this uncertainty drops below a lower threshold, T min (Fig. 5b).
As previous theoretical work has shown 25 , the zero-excitation strategy (that is, traditional state-estimate feedback) cannot minimize the state estimation error and hence, not surprisingly, results in poor tracking performance (Fig. 5c), thus illustrating the need for an additional active-sensing component in the face of adaptive sensing and perceptual fading.The persistent-excitation and triggered-excitation strategies both facilitate substantially better position control than does the zero-excitation strategy (Fig. 5c,d).Although these two strategies resulted in comparable tracking errors (e RMS ; Fig. 5b,c), the triggered excitation was more efficient, requiring substantially lower control effort (u RMS ; Fig. 5g,h).Moreover, unlike the persistent-excitation strategy, triggered excitation generated a distinctive broad-shouldered velocity distribution that featured a sharp peak near zero, with broad shoulders corresponding to bursts of fast movement (Fig. 5j,k).This distribution was strikingly similar to experimental observations across organisms (Figs. 1 and 4 and Extended Data Figs.4-6), suggesting that such broad shoulders are a signature (if not definitive proof) of a mode-switching strategy.
We showed that active exploration is essential for better tracking performance as it improves state estimation.But, there is a point of diminishing returns: although higher (more energetic) active excitation can result in excellent state estimation, there is a point beyond which these additional active-sensing movements lead to greater tracking errors.
To contrast between persistent excitation and triggered excitation, we performed a numerical study to obtain the variance of the active-sensing signal u a (t) that minimizes the RMS tracking error for the persistent excitation strategy, e PE,min .Note that persistent excitation is the limiting case of triggered excitation with extremely low threshold values (that is, insuring that the active-sensing mode is always 'on').With that optimum stimulation obtained from persistent excitation, we next performed a parameter sweep involving threshold pair (T max , T min ) in the triggered excitation.We discovered that the choice of thresholds in the triggered-excitation strategy plays an important role-with the right choice of parameters we could achieve better tracking performance (Fig. 5m) at reduced control effort

Article
https://doi.org/10.1038/s42256-023-00745-y(Fig. 5n).The choice of thresholds also shapes the velocity to best extract sensory information; with low thresholds, the statistics approach that of the persistent excitation, whereas high thresholds lead to velocity distributions with higher kurtosis (departure from normality), while requiring less control effort (Extended Data Fig. 7a-c).
How does sensory salience affect performance of the triggered excitation (mode switching) heuristic?To simulate the effects of changes in sensory salience, we parametrically varied the sensory noise variance while keeping constant the switching thresholds T min and T max .As the sensory noise variance was increased (simulating a decrease in salience), the kurtosis value of the velocity distribution decreased, numerically approaching normality in the limit of high sensory noise (Extended Data Fig. 7d-g).This trend of decreased kurtosis in the face of increased noise variance captures the widespread observation that, ) Article https://doi.org/10.1038/s42256-023-00745-y in animals, the velocity statistics tend towards a Gaussian distribution as sensory salience is decreased.Moreover, the underlying mechanism, namely, increasing frequency of bursts of exploratory movements, matches our experimental observations in E. virescens, which performed more frequent transitions to fast movements and spent less time in the slow mode in the lights-off trials than in the lights-on trials (Fig. 2c,d).These analyses clarify that this trend towards a Gaussian distribution with decreased salience is an epiphenomenon of mode switching: as the frequency of fast movement bursts increases, it overwhelms the task-oriented movements, diminishing the prominence of the central peak.

Discussion
We examined explore-exploit trade-offs in the context of goal-direct motor behaviours, such as station keeping, postural balance and plume tracking, that require active, exploratory movements to enhance sensation.We discovered that the velocity distributions that emerge from the interplay between exploratory movements and goal-directed control are broad-shouldered across taxa, and that this distinctive distribution of movements is robustly modulated by sensory salience.The bouts of ancillary movements that comprise the broad shoulders of these velocity distributions are commonly described as 'active sensing', that is, the expenditure of energy by organisms for the purpose of sensing 40 , for example, ancillary movements described here.Active sensing also includes the emission of energetically costly signals such as electric fields by weakly electric fishes 41 and echolocation calls in dolphins, birds and bats [42][43][44][45] .Active-sensing research in humans, in relation to touch, was popularized in the 1960s by J. J. Gibson 1 , and the original ideas date back at least to the eighteenth century (for a historical account, see ref. 40).Surprisingly, active sensing is largely avoided in engineering design despite being ubiquitous in animals.The performance of engineered systems may benefit from the generation of movement for improved sensing.An algorithm known as Ergodic Information Harvesting (EIH) 3 could be used to control movements for sensing in artificial systems.This algorithm balances the energetic costs of generating movements against the expected reduction in sensory entropy.The EIH has been tested in relation to several animal model systems, and produces plausible animal trajectories 3 .
Interestingly, the EIH algorithm produces the opposite trend in kurtosis of velocity distributions in relation to sensory salience (Extended Data Fig. 2g-l and Extended Data Table 3) that we observed in our experiments, reanalysis of previous data and in our model: as sensory salience decreases, there is an increase in active-sensing movements but a decrease in kurtosis (Extended Data Table 2).That EIH leads to decrease in kurtosis occurs in part because EIH generates continuous-sensing movements, and does not incorporate mode switching.A refined EIH model, that generates the temporally distinct periods of sensing movements that characterize mode switching would better reflect our findings in animals, and is a promising strategy for improving the performance of robotic control systems.
How mode switching is manifest across the diverse biological systems we examined is a compelling open question.Many of these control systems have evolved via convergent evolution in which adaptive strategies emerge independently across lineages.One result of convergent adaptation is that species often rely on idiosyncratic features, such as feathers or skin flaps, to achieve the same adaptive strategy, such as flapping flight.We infer that the mechanisms for mode switching are present in control systems that range from subcellular systems 46 to neural systems in vertebrates.
The mechanisms for mode switching in vertebrate nervous systems may emerge at different levels within sensorimotor control pathways.For example, neurophysiological recordings show that sensory salience can be encoded in brain circuits via synchronization and desynchronization of spiking activity 47 .Such population coding of salience [48][49][50] , when coupled with a threshold, could trigger discrete bursts of motor activity for sensing 8 .Motor circuits for the production of discrete bursts of movement occur in spinal circuits 51 .
These discrete bursts of movements could arise from reflex-like, threshold-based activity in animals, akin to how Mauthner cells trigger a cascade of motor activity when sensory inputs exceed a threshold 52 .
A key difference between reflex-like, threshold-based behaviours and the mode switching we describe in this paper would be that the signal in question would arise from an internal representation of sensory uncertainty, rather than from the overall level of sensory excitation.Such a reflex-like action could produce stereotyped forms of interactions with the external environment in relation to sensing 8 .
A common engineering approach to sensing and control is to add sensors and improve sensor performance, particularly at low frequencies, effectively side-stepping the need for active-sensing movements altogether.Such improved sensing enhances observability without relying on movement.In stark contrast, organismal sensor systems are almost invariably adapting (high pass), necessitating active sensing.Irrespective of whether organisms have achieved an optimal solution to the control problem (or instead are limited by evolutionary constraints on sensor performance), the widespread convergent evolution of a common active-sensing strategy nevertheless suggests an alternative engineering design paradigm.The confluence of adapting sensors 53 and the uncertainty-triggered mode-switching heuristic presented in this paper provide a new roadmap for movement control of robotic systems.
In this paper, the explore-exploit trade-off arises from the need for active-state estimation 28 in a subset of tasks in which movement is used both for acquisition of information and achieving task goals.However, similar trade-offs arise in a wide variety of potentially more complex behaviours.For example, in foraging where the resources are found in patchy distributions, organisms balance the trade-offs between exploiting a local food source, exploring for distant sources 54 and the costs of predation across the habitat 55 .Similarly, reinforcement learning involves choosing whether to adhere to a familiar option with a known reward or taking the risk to explore unknown options that can lead to increased rewards over the longer term 56 .We do not have direct evidence that the broad-shouldered feature we have identified in animal movements described here (Figs. 1 and 4)-reflecting the manifestation of mode switching-are also be found in these behavioural domains across taxa.Recent evidence from studies of human reinforcement learning, however, appear to be consistent with mode-switching behaviour.

Tracking of glass knifefish
Subjects.We obtained adult, weakly electric, glass knifefish E. virescens (10-15 cm in length) from commercial vendors, and housed the fish according to the published guidelines 57 .The water temperature in the experimental tank was kept between 24 °C and 27 °C, and conductivity ranged from 10 μS cm −1 to 150 μS cm −1 .Fishes were transferred from the holding tank to the experimental tank 12-24 h before the experiments to allow for acclimation.All experimental procedures were approved by the Johns Hopkins Animal Care and Use Committee, and followed guidelines established by the National Research Council and the Society for Neuroscience.
Experimental apparatus.The experimental apparatus was similar to that used in previous studies 2,6,8,23,58 .The refuge was machined from a 152-mm-long segment of 46 × 50 mm rectangular PVC tubing, with the bottom surface removed to allow the camera to record the ventral view of the fish.On both sides of the refuge, a series of 6 rectangular windows (6 mm wide × 31 mm high, spaced 19 mm apart) were machined, through which to provide visual and electrosensory cues.

Article
https://doi.org/10.1038/s42256-023-00745-yA computer sent designed digitized input stimuli (25 Hz) from LabVIEW (National Instruments) to a Field Programmable Gate Array based controller for a stepper motor (STS-0620-R, HW W Technologies). The stepper motor drove a linear actuator, leading to the one-degree-of-freedom refuge movement in real time.A video camera (pco.1200,PCO AG) captured fish movements through mirror reflection at 100 Hz.The captured frames (width × height, 1,280 pixels × 276 pixels) were saved as 16 bit .tiffiles via camera application software (pco.camware,PCO AG).
Experimental procedure.The experiments were conducted in two illuminance levels-around 0.3 lx (lights off) and 80 lx (lights on).Each trial lasted for 60 s.During the initial 10 s of each trial, the refuge was actuated to follow a 0.45 Hz sinusoidal trajectory, the amplitude of which was gradually increased to 3 cm, and then decreased to 0 at the end of the 10 s interval, in a similar fashion as described in ref. 2. After the initiation phase, the refuge remained stationary for 40 s, finally followed by a termination phase for 10 s, during which the refuge was actuated in a similar fashion as during the initiation phase.
Tracking algorithm.To observe fine details of the fish movement, we used a high frame rate in our video recordings.High tracking accuracy was essential as the position and velocity data were likely to be contaminated by measurement noise.To ensure high tracking accuracy, the refuge and fish position were analysed by custom video tracking software 59 developed by Balázs P. Vágvölgyi from the Laboratory for Computational Sensing and Robotics, at Johns Hopkins University.
The tracking algorithm worked in two phases.The first phase was template matching, which roughly located the targets (fish or refuge).In the first frame of a given video, a rectangular region was manually selected around the target to create a template.On subsequent frames, a neighbourhood region around the template (±20 pixels) from the previous frame was selected for the computation of a normalized two-dimensional cross-correlation matrix.If the target changed its orientation in the new frames, before computing the normalized two-dimensional cross-correlation, the new image frame was first rotated to match the orientation of the template from previous frame.If needed, the areas of the image were sampled (then scaled and interpolated if necessary) with subpixel accuracy.
After creating the template, the second phase applied the Levenberg-Marquardt algorithm to find the global maximum of the normalized cross-correlation function.This step produced a match between the template and target at each frame, with subpixel accuracy.We performed extensive preliminary testing and analysis to confirm that the remaining measurement errors had smaller variance than the stochastic movements of the fish.Data processing.The tracking algorithm stored the fish position in both horizontal and vertical directions (originally in pixels, along with the respective pixel-to-metre conversion factor) and the angle of orientation (in degrees) in .csvfiles.We used only the data while the refuge was stationary (40 s, 4,000 data points in total) for each trial.To further reduce the measurement noise, the position data were filtered through a Butterworth zero-phase distortion filter (filtfilt command in MATLAB) with a 10 Hz cut-off frequency.Fish velocity in the horizontal direction was computed as forward differences of the horizontal position time series.For GMM with inflection-point-based clustering, the velocity (v) data from each individual fish at a specific lighting condition were clustered into three components, slow, fast positive and fast negative (Extended Data Fig. 3a,b), using two velocity thresholds, v L and v H (v L < v H ), resulting in two behavioural modes-slow and fast (fast positive and negative were combined).The velocity threshold values were computed by finding the inflection points of the GMM fits to the velocity data, f GMM , specific to a lighting condition.To numerically identify the inflection points of f GMM , we numerically computed the spatial second-order derivative of f GMM ( f ′′ GMM ), and located the first and the last indices of the array

Identification and characterization of behavioural modes.
was satisfied for a given ad hoc constant c, selected as described below.
This method separated the central peak of the f GMM , velocity distribution around zero velocity, from the broad shoulders.We chose c = 0.005 for all the individual fish irrespective of the lighting conditions, except for fish 1 lights-off trials (c = 0.02); the different c value for fish 1 lights-off trials was chosen so that the relative area under the central peak of the distribution was less than 0.6 (similar to other fish during lights-off trials).For further analysis of these behavioural modes, we assumed a continuous-time Markov chain model (Extended Data Fig. 3c,d).For infinitesimal dt, the transition probabilities from state i to state j, Q ij are given as follows: where O denotes order, and the probability matrix P with p ij = Pr(v(t) = j|v(0) = i) and transition rate matrix Q with entries Q ij satisfy the first-order differential equation whose solution is given by For every trial from each individual fish, we computed the probability matrix P with entries p ij , i = 1, 2, j = 1, 2 where states 1 and 2 correspond to slow (exploit) and fast (explore) modes, respectively.We used the approximation to the matrix exponential in equation ( 6), for the computation of the transition rates between slow and fast modes in each trial from the respective probability matrix, P.Here h is time step = 0.01 s and I is 2x2 identity matrix.
For HMM clustering, we combined all the positional trial data (x t ) from all the five fish at a specific lighting condition along with their negatives (−x t ).The subscript t is a variable representing time.We included the negative data to eliminate any directional bias.We assumed that the observed measurements of position, x t , follow a homogeneous Markov switching first-order autoregressive model: where the superscript s t ∈ {1, 2, 3} refers to the hidden discrete state, coefficients α s t k ∈ 0, 1 are model parameters, ε_t is Gaussian white noise, and σ is the noise variance.We fit this model using the NHMSAR package in R.
The HMM fitting resulted in three clusters similar to slow, fast positive and fast negative, as obtained with the GMM with inflection-point-based clustering method (Extended Data Fig. 3e-h).Finally by combining fast positive and negative, we ended up with two behavioural modes-fast and slow-for further computation of switching frequency and residence time.In GMM with MAP-based clustering, GMM models with three components were fitted to the velocity data from each individual fish at a specific lighting condition.We assigned the cluster index for each data point based on the maximum a posteriori probability using Bayes' rule.This method required a post hoc assignment of which cluster or clusters correspond to the 'slow' behavioural mode to compute residence time; see, for example, Extended Data Fig. 3i-m.
All analysis was performed using code written in R and MATLAB.

Simulation
Sensory adaptation is a robustly observed phenomenon among organisms ranging from unicellular amoebae 37,38 to humans 26 where the sensory systems stop responding to constant stimuli.Here we modelled this adaptive/high-pass nature of the sensory receptors as a 'motion-dependent sensor' for which we assumed a nonlinear measurement model 24,25 with sensory noise w 2 (t): Here, s(x) is the position-dependent sensory scene experienced by the organism.For the present study, we assumed a quadratic sensory scene s(x) = 1 2 αx 2 + βx with non-zero constant sensory-scene parameters α and β.This assumption on sensory scene yields g(x) = αx + β, a linear function of position, x.
Due to the presence of the nonlinearity in the measurement, we used an extended Kalman filter for state estimation, a common heuristic.For the state-feedback component, we applied where k 1 and k 2 are the position and velocity feedback constants, respectively.In the triggered-excitation scheme, for the uncertainty measure (M) we used the trace of the state estimation error covariance matrix, Tr(P(t)).When the uncertainty measure Tr(P(t)) rose above a maximum threshold, T max , the controller generated active-sensing component, u a (t) as a Gaussian input with fixed power spectral density and it continued to inject the input until Tr(P(t)) dropped below a lower threshold, T min .At this point, the controller switched back to traditional state-feedback form.For the persistent-excitation scheme, the controller continued to inject a Gaussian input u a (t) for all time.
To obtain the critical excitation level of the active-sensing component u a,crit (t) for optimum tracking performance in persistent excitation, we chose 30 logarithmically spaced variance values of u a (t) from 1 to 100.From the mean of 100 independent simulations for each variance value, we obtained u a,crit (t) ≈ 9.33, which achieved the minimum RMS tracking error of e PE,min ≈ 0.071 and RMS control effort u PE ≈ 10.Using this critical value for the excitation u a,crit (t), we studied the effect of thresholds in triggered excitation by varying T max and T max /T min linearly from 4 × 10 −3 to 10 × 10 −3 , and 0.5 to 1, respectively, and performed 300 independent simulations for each pair of values.
The system parameters were chosen from previous studies 6,24 as 56 and ω n = 1.05 × 2π.The process noise, w 1 (t) and sensor noise, w 2 (t) were chosen as fixed Gaussian noise inputs with variances 0.03 and 10, respectively.

Statistics
All the statistical analysis was performed with sign test and Mann-Whitney-Wilcoxon test using custom codes written in R version: 4.3.0,R Core Team, and MATLAB version: 9.12 (R2022a), MathWorks.For all tests, the significance level was set to 0.05.The experimental and simulation data are provided as either mean plus or minus the standard deviation (μ ± s.d.) or mean plus or minus the standard error of the mean (μ ± s.e.m). ) with colors the same as in (c).Mean RMS velocity across trials for all fish in lights-off trials was greater than in lights-on trials (one-sided p-values are 0.0004, 0.0001, 0.0036, 0.0003, and 0.0001, respectively).(e, f) Q-Q plots from a single representative fish (fish 1) comparing the velocity data from lights-off (g) and lights-on trials (h) with theoretical quantiles from a normal fit (magenta) and GMM fit (blue), respectively.Lesser deviation from the reference line (black dashed) for GMM fits with three components than for the normal, suggested better fitting of the former.The Q-Q plots also showed that the lights-off trial data were closer to normal distribution fits than were those of lights-on trial data.(g) Cumulative difference in Bayesian information criterion (ΔBIC) values for varying number of components in GMM (top: lights off; bottom: lights on).The gray dashed line corresponds to three-component GMM.(h) Box and whisker plot showing kurtosis values of individual trials for all fish (N = 5) with colors the same as in (c).For all fish, mean kurtosis values across trials in lights-on trials was greater than in lights-off trials (one-sided p-values are 0.0034, 0.0188, 0.0005, 0.0445, and 0.0068, respectively).All box and whisker plots include the median line, the box denotes the interquartile range (IQR), whiskers denote the rest of the data distribution and outliers are denoted by points greater than ± 1.5 × IQR.The total number of lights-off trials (n) for fish 1 and 3 was 7, and for the rest, it was 10 trials per condition per fish.All p-values were calculated using the Mann-Whitney-Wilcoxon test.
https://doi.org/10.1038/s42256-023-00745-yhistogram (e) with the kurtosis value, κ and the Q-Q plots (f).(g-i) Simulated velocity traces (n = 9) using Ergodic Harvesting Information (EIH) algorithm for weak signal (g; SNR ≤ 30 dB equivalent to jamming amplitude ≥ 10 mA) (g), corresponding histogram (h) with the kurtosis value, κ and the Q-Q plots (i).(j-l) Simulated velocity traces (n = 9) using Ergodic Harvesting Information (EIH) algorithm for strong signal (d; SNR ≥ 50 dB equivalent to absence of jamming) ( j), corresponding histogram (k) with the kurtosis value, κ and the Q-Q plots (l).Colors and styles are same as in (a-c).Mean ± SD of the respective RMS values of experimental velocity traces (v RMS ) are shown next to plots of (a,d).The fitting performances of GMM and the normal distribution for simulated trajectories were comparable.See Extended Data Table 3 for statistical details.
Extended Fig. 3 | of velocity data into different behavioral modes.Representative histograms of lights-off (a) and lights-on (b) trials from the same fish with three clusters: slow (orange), fast positive (green) and fast negative (blue).The clustering was based on identifying velocity thresholds vL and vH on the Gaussian mixture model (GMM) fit (grey line) as indicated by blue and green markers, respectively (see Methods for details).(c,d) Top: two-state (F: fast velocity both positive and negative combined and S: slow velocity) Markov process showing mean transition rates for a representative individual in lights-off (a) and lights-on trials (b).Bottom: transition rates corresponding to state transitions: F → S in (e) and S → F in (f), respectively for lights-off (black) and lights-on (red) trials.The transition rate for F → S was higher in lights-on trials (one-sided p-values are 0.0068, 0.0001, 0.0046, 0.0023, and 0.0093, respectively) whereas the rate for S → F was higher in lights-off trials (one-sided p-values are 0.0006, 0.0001, 0.0001, 0.0018, and 0.0001, respectively).(e-h) Velocity histograms (e,f) and traces (g,h) from lights-off (e,g) and lights-on (f,h) trials from the same fish from (a,b) showing three clusters using Hidden Markov model (HMM) based clustering.The colors are same as in (a,b).(i-l) Velocity histograms (i,j) and traces (k,l) from lights-off (i,k) and lights-on ( j,l) trials from the same fish from (a,b) showing three clusters using maximum a posteriori (MAP) clustering based on three-component GMM fits.The probability density functions (pdf) of respective components are shown as dashed lines in (i,j).(m) Box and whisker plots showing residence time in slow mode, computed as the percent of the trial duration (40 s), for lights-off (black) and lights-on (red) trials computed using different clustering algorithm.For details see Methods.For all the clustering algorithms, the computed residence time was significantly higher during lights-on trials than lights-off trials (one sided p-values are 0.0002, 0.0034, 0.0001, and 0.0001, respectively).All box and whisker plots include the median line, the box denotes the interquartile range (IQR), whiskers denote the rest of the data distribution and outliers are denoted by points greater than ± 1.5 × IQR.In (c,d) the total number of lights-off trials (n) for fish 1 and 3 was 7, and for the rest, it was 10 trials per condition per fish.All p-values were calculated using the Mann-Whitney-Wilcoxon test.
Extended Data Fig. 5 | Reanalysis of the tactile response in crepuscular hawkmoth, Manduca sexta 20 , and active exploratory movement of three different species of hawkmoths during flower tracking 19 shows similar broad-shouldered velocity distributions.(a-f) Histograms of relative radial angular velocity for different shape of the flower as indicated.'C' is the curvature parameter for the description of the lateral traces of the corollas for first (a-c) and seventh (d-f, early-learning) visit.The magenta dashed and the blue solid curves in (d) correspond to a normal and GMM fit with three components, respectively.The kurtosis (κ) values and the total number of trajectories (N) analyzed are indicated next to the respective panels in (a-f).The dataset analyzed here was collected at 100 Hz.For the present study, we focused on the data during the pre-feeding phases only.(g-l) Histograms of active exploratory velocity at low (g-i: 15 lx) and high ( j-l: 300 lx) illumination level in three different species of hawkmoth-nocturnal Deilephila elpenor (g,j), diurnal Macroglossum stellatarum (h,k), and crepuscular Manduca sexta (i,l).Colors of the fits are same as in (a-f).The kurtosis (κ) values and the total number of hawkmoths (N) analyzed are indicated.(m-o) Box and whisker plots showing the RMS active exploratory velocity for all three species of hawkmoths analyzed at different illumination levels.All box and whisker plots include the median line, the box denotes the interquartile range (IQR), whiskers denote the rest of the data distribution and outliers are denoted by points greater than ± 1.5 × IQR.Sample sizes (n) are shown in each boxplot.The one-sided p-values were computed using the Mann-Whitney-Wilcoxon test.The datasets analyzed here were collected at 100 Hz with one trial per hawkmoth (N = n).

Fig. 1 |
Fig. 1 | Velocity distributions are broad-shouldered.a,b, Side view (schematic; a) and bottom view (infrared image; b) of a fish inside a stationary refuge.The bright ventral patch on the fish was tracked (green dot) as the fish swam inside the refuge (magenta dot).c,d, Position traces during lights-off trials (n = 7; c) and during lights-on trials (n = 10; d) from a single representative fish.e,f, Corresponding velocity traces (left) and velocity histograms (right) over the same range of velocities for lights-off trials (e) and lights-on trials (f), with the kurtosis value κ indicated.Note that the time and probability scales of the horizontal axes are shown below in f.A three-component GMM (blue solid curve) fits the data better than the normal fit (magenta dashed curve) as indicated by the lower Kullback-Leibler divergence and Bayesian information criterion values; see Extended Data Table1for statistical details.One lights-off trial with large positive velocity is truncated; see Extended Data Fig.1a,b for full version.

Fig. 3 |
Fig. 3 | Diversity of organisms and sensing modalities used for analysing mode-switching strategies.The major sensing modalities (vision, tactile sensing, audition, olfaction and eletrosensation) used for task execution are listed next to the organisms (four species of mammals, a species of ray-finned

Fig. 4 |
Fig. 4 | Broad-shouldered velocity distribution is found across taxa, behaviours and sensing modalities.Reanalysis of data from eight previous studies reveals a convergent statistical structure of movements across a range of organisms and behaviours.a, Postural sway in humans (Homo sapiens) during maintenance of quiet upright stance17 .b, Microsaccades in humans (H.sapiens) during fixated gaze21 .c, Bilateral eye movements in mice (M.musculus) during prey (cricket) capture15 .d, Pinnae movements in big brown bats (E.fuscus) while echolocating prey (mealworm)16 .e, Olfactory-driven head movements in eastern moles (S. aquaticus) in response to food (earthworms)14 .f, Odour plume tracking in American cockroaches (P.americana) in response to sex pheromone (periplanone B)18 .g, Tactile sensing by Carolina sphinx hawkmoth (M.sexta) while searching for a flower nectary20 .h, Visual tracking of swaying flower by statistical details.Mice eye image in c adapted with permission from ref. 15 under a Creative Commons License CC BY 4.0.ML CoM, Mediolateral Center of Mass.

Fig. 5 |
Fig. 5 | Template model illustrating three different exploration strategies.a, Schematic of the triggered-excitation (mode-switching) strategy.The musculoskeletal plant for animal locomotion has two states-position (x) and velocity (v).The state estimator has access to noisy measurements from a nonlinear adaptive sensor (g(x)v).The state estimator (extended Kalman filter) is designed to work in tandem with the mode-switching controller.The controller output, u, comprises both state feedback (−f( x, v)) and an active-sensing component (u a (t)).See Methods for details.b, Triggered-excitation (TE) strategy showing the temporal traces of measure of uncertainty (M, trace of the error covariance) with threshold levels T min = 4.8 × 10 −3 and T max = 6 × 10 −3 (top), input u (bottom; active-sensing component, u a (t): light blue; state-feedback component, −f( x, v): dark blue).The triggering started as M exceeded T max and the triggering continued until M dropped below T min .c-e, Simulated position traces (actual states: teal, estimated states: red) using three different exploratory movement strategies for u a (t): zero excitation (c), persistent excitation (d) and triggered excitation (T max ) along with the state feedback.The respective RMS values of the tracking error (e RMS ) are shown in the panels.f-k, Controller input traces (f-h) and velocity histograms (i-k) for various schemes as in c-e.Respective RMS values of the inputs (u RMS ) are shown in f-h.In i-k, the fits with a normal distribution (magenta dashed) and three-component GMM (blue solid) are shown along with the respective kurtosis (κ) values.l, Effect of exploratory movement (variance of u a (t)) on tracking error (e) and control effort (u) in persistent excitation.The minimum RMS tracking error and the corresponding control effort are denoted as e PE,min and u PE,min , respectively.m,n, Effect of threshold pair (T max , T min ) in triggered excitation on tracking error (m) and control effort (n) at optimum variance of u a (t) corresponds to e PE,min .The solid lines in m and n show the respective mean and the shaded regions in m correspond to respective s.e.m. (n = 300 independent simulations).Note that with the right choice of threshold pair, the triggered-excitation scheme can achieve lower tracking error with substantially lower control effort.

Extended Data Fig. 1 |
Comparison of fish movement in lights-on trials versus lights-off trials.(a) Velocity trace of the truncated trial data (black) with traces from other trials (gray) for the same fish from Fig. 1c.(b) Histogram of all trials (n = 7) using same length scale, and the three-component Gaussian mixture model (GMM) fit.(c) Magnitude of discrete Fourier transform of velocity traces from (a) with total number of trials (n) indicated next to the plots.The solid line and the shaded region denote mean and the standard error of mean, respectively.(d) Box and whisker plot showing RMS values of individual trials for all fish (N = 5

. 2 |
Reanalysis of the experimental and simulated trajectories from Chen et al. 3 .(a) Experimental velocity traces (n = 10) with 'jamming' of the electrosensory system in Eigenmannia virescens, which decreased the salience and reliability of electrosensory navigation.(b) Corresponding histogram, with the kurtosis value, κ.The magenta dashed and the blue solid curves correspond to a normal and GMM fit with three components, respectively.(c) Q-Q plots comparing the sample velocity data for all trials (n = 10) from (a) with theoretical quantiles from the same normal (magenta) and GMM fit (blue) from (b).Clearly, the GMM fit was better than the normal.See Extended Data Table 2 for statistical details. (d-f) Experimental velocity traces (n = 10) with jamming electrode off (d), corresponding

Data Fig. 6 |
Reanalysis of the directed movement of Amoeba proteus and Metamoeba leningradensis in response to an electric field (galvaontaxis)22 .Migration trajectories (N = 50) of A. proteus (a), temporal traces of velocities (b) in the transverse direction of the applied electric field derived from the migration data, and the corresponding velocity histogram (c) with kurtosis (κ) value.The magenta dashed and the blue solid curves in (c) correspond to a normal and GMM fit with three components, respectively.(d-f) Galvanotaxis response in M. leningradensis.The panels are same as in (a-c).Image data for both datasets were collected at 0.1 Hz.Extended DataFig.7 | Effect of thresholds, T min and T max in Triggered Excitation strategy.(a-c) Heatmaps showing mean RMS tracking error in Triggered Excitation (e TE , a), mean RMS control effort (u RMS , b) and mean kurtosis (κ, c) of the resultant velocity distributions from 100 independent simulations at critical excitation level corresponds to minimum RMS tracking error in Persistent Excitation (e PE,min in Fig. ??l) as thresholds T min and T max were varied.The dashed line in (a-c) shows the phase transition based on the difference between the tracking error in Triggered and Persistent Excitation.The region inside the line corresponds to parameter space where the tracking error in Persistent Excitation is less than Triggered excitation, whereas outside the region Triggered excitation performs better.(d) Variation of kurtosis, κ (green, left y-axis), and Kullback-Leibler (K-L) divergence (right y-axis) of normal distribution (magenta dashed) and Gaussian mixture model (blue solid) fit to the velocity distribution with sensor noise variance, σ 2 .(e,f) Velocity histograms with kurtosis values are shown for sensor noise variance, σ 2 = 0.70 and 2, respectively, as indicated by (i) and (ii) in (d).(g) Variation of RMS control effort (u RMS ) with sensor noise variance, σ 2 .The shaded regions in (d,g) denote the respective standard deviations (n = 25 independent simulations per σ 2 ).Extended Data Table 1 | Comparison of Kullback-Leibler (K-L) divergence and Bayesian information criterion (BIC) for the three-component Gaussian mixture model (GMM) and normal fits to the velocity data of Eigenmannia virescens during lights-off and lights-on trials GMM with lower values of K-L divergence and BIC is favored over normal.Extended Data Table 2 | Summary of the reanalysis of the published data across nine different species 3,14-21 showing Kullback-Leibler (K-L) divergence and Bayesian information criterion (BIC) for the normal and the three-component Gaussian mixture model (GMM) fits to the velocity data and the kurtosis value (κ) .Extended Data Table 3 | Summary of comparison between different strategies of template model and Ergodic Information Harvesting (EIH) model showing Kullback-Leibler (K-L) divergence and Bayesian information criterion (BIC) for the normal and the three-component Gaussian mixture model (GMM) fits to the simulated velocity data and the kurtosis value (κ) .