^{1}

^{2}

^{2}

^{3}

^{*}

Conceived and designed the experiments: BB. Performed the experiments: BB. Analyzed the data: BB AM. Contributed reagents/materials/analysis tools: BB GS AM CH. Wrote the paper: BB. Other: Conceived the study, selected the analytical tools, conducted the behavioral experiments: BB. Contributed crucially to the implementation of the S-Map procedure, its interpretation and cross-checked selected results in blind; read and commented on the paper: CH GS. Performed all mathematical analyses and advised B.B. on their selection, read and commented on the paper: AM CH.

The authors have declared that no competing interests exist.

Brains are usually described as input/output systems: they transform sensory input into motor output. However, the motor output of brains (behavior) is notoriously variable, even under identical sensory conditions. The question of whether this behavioral variability merely reflects residual deviations due to extrinsic random noise in such otherwise deterministic systems or an intrinsic, adaptive indeterminacy trait is central for the basic understanding of brain function. Instead of random noise, we find a fractal order (resembling Lévy flights) in the temporal structure of spontaneous flight maneuvers in tethered

According to Laplace, randomness is only a measure of our “ignorance of the different causes involved in the production of events.”

However, even the best-understood behavioral systems display a residual of variability, which has so far prevented exact predictability of individual behavior. There are a number of systems from single neurons and synapses

A–According to the robot-hypothesis, there is an unambiguous mapping of sensory input to behavioral output. If the behavioral output is not constant in a constant environment, there are a number of possible sources of noise, which would be responsible for the varying output. B–In a competing hypothesis, non-constant output is generated intrinsically by an initiator of behavioral activity. Note that the sources of noise have been omitted in B merely because their contribution may be small, compared to that of the initiator, not because they are thought to be non-existent.

Analyzing the structure of behavioral variability may provide evidence for understanding whether the variability is the result of cumulated errors in an imperfectly wired brain (system noise) or whether the variability is under neural control. In this study, we take advantage of turning behavior in tethered

The fly is flying stationarily in a cylindrical arena homogeneously illuminated from behind. The fly's tendency to perform left or right turns (yaw torque) is measured continuously and fed into the computer. In closed-loop, the computer controls arena rotation (single stripe or uniform texture as patterns on the arena wall). An additional white screen (not shown) covered the arena from above for all groups.

Naively, if the production of torque spikes in our featureless or uniform environment were due to random noise in the

A–GRIP analysis of ISIs. Plotted are the mean standard deviations from the theoretically expected random value for fly ISI series and the random series generated by a Poisson process. The fly deviations are all significantly larger than the values for the computer-generated series. B–Log-log plots of ISIs. The Lévy exponent μ is calculated from the inclination of the linear fit. A Lévy distribution is defined as 1<μ<3. Smaller values indicate a larger proportion of long ISIs. A Cox Process (

One may argue that the assumption of a constant spike rate is arbitrary, overly simplistic and that more complex stochastic processes are likely to be at work, even in flies. A well-known example of such stochastic processes is a doubly stochastic Poisson process (or Cox Process)

Lévy flights, a special class of Markov processes, are scale invariant and often associated with power-laws described in many other systems

A standard method of testing for renewal processes without memory (i.e., Markov, Lévy or Cox processes) is to compare the original sequence to randomly shuffled (“surrogate”) sequences. This surrogate data set maintains the same relative frequency of ISI durations as the original data, but destroys the ordering of the intervals. A significant difference between surrogate data and original data indicates that conditional probabilities are not involved in the generation of the series. For this comparison, we first computed the correlation dimension

A–While the correlation dimension converges on a group-specific value with increasing embedding dimension for fly-generated ISIs (

However, there are yet more complex composite stochastic models which, like the fly data, can exhibit a fractal structure

If the slope of the log-log plots of the r.m.s. fluctuation (exponent α, see

The dependence of the α-values on the nonlinearity contained in the BPPs entices to hypothesize that what is needed to achieve long-term correlations such as those observed in flies (this study and

All the previous analyses showed that

A–S-Map results. Depicted are the averaged results for fly ISIs and raw yaw torque series (for clarity, only

A popular concept of animal behaviour includes the transition between motivational states. True state shifts are not random features of a time series but instead formally associated with the idea of nonlinearity

Even small fly brains can control behavior with minute precision. For instance, male house flies closely track the evading flight maneuvers of female flies with only a lag of about 30ms

Behavioral variability is a well-known phenomenon. It is so pervasive that the semi-serious Harvard Law of Animal Behavior was coined: “Under carefully controlled experimental circumstances, an animal will behave as it damned well pleases.” It is the source of this variability which is under scrutiny here. The current neuroscientific consensus posits that the source of the variability is noise, rendering the variability random or stochastic. We show here that random noise cannot be the sole source of behavioral variability. In addition to the inevitable noise component, we detected a nonlinear signature suggesting deterministic endogenous processes (i.e., an initiator) involved in generating behavioral variability. It is this combination of chance and necessity that renders individual behavior so notoriously unpredictable. The consequences of this result are profound and may seem contradictory at first: despite being largely deterministic, this initiator falsifies the notion of behavioral determinism. By virtue of its sensitivity to initial conditions, the initiator renders genuine spontaneity (“voluntariness”

The variability in spontaneous fly turning behavior is not solely due to nonlinearity; rather, the nonlinear processes controlling the behavior also have to operate at just the right parameters to produce instability. Moreover, the number of these nonlinear processes has to be small, as nonlinear signatures disappear with increasing superposition of multiple nonlinear processes

What, if any, ecological niche has spontaneous flight behavior in

Because theoretical work suggests a range of competitive advantages for indeterminate behavior in virtually all animals

A–Open-loop model as proposed in

But what, if any, difference does it make when behavioral variability–despite being largely unpredictable–is not entirely stochastic, but nonlinear and unstable? The tedious distinction between random noise and unstable nonlinearity is worthwhile, because the former points to extrinsic origins of variability, whereas the latter indicates intrinsic origins. Technical advances frequently lead to a significant increase in signal to noise ratios. Such advances would increase the predictability of a brain where the main source of variability stems from noise. In contrast, noise reductions will only marginally change the predictability of a nonlinear brain whose output is fundamentally indeterministic, despite the deterministic rules that govern it. Given that there is a cost associated with producing indeterminate behavior

This insight has implications for our understanding of the general function of brains. The most fundamental brain function is to produce adaptive behavior. Adaptive behavior is the ability to orient toward specific goals in the environment and to control actions flexibly in pursuit of those goals. By and large, the every-day world we live in is Newtonian: predictable and deterministic. If we lose balance, we fall, if we neglect obstacles in our path, we collide with them and if we reach for an object, we can grasp it. Hence, no ambulatory animal could survive without its set of adaptive, hard-wired sensorimotor rules shaped by evolution and tuned by experience. No male house fly would ever catch its mate. At the same time, the world is full of surprises: the unexpected pursuit by a male house fly, the rejection of your manuscript or the next move by your chess opponent (or a predator). In such cases, not even the most complex stimulus-response programs (learned or innate) will help an animal in evading the undesired surprises and obtaining the desired ones. If the evasive actions taken by the female house fly were predictable, males could short cut and catch them with much less effort. It is essential to not leave the generation of behavioral variability to chance (i.e., noise), but to keep it under neural control (i.e., nonlinearity). As such, evolution can fine-tune the balance between sensorimotor mapping and superimposed indeterminacy, defining the required compromise between spontaneous and reactive behavior. The variability of systems under tight constraints will be explained mostly by noise (because the variability under neural control is minimized, such as escape and pursuit responses in flies)

If unpredictability is so important, why is the ‘random number generator’ in the fly brain not perfect? For one, perfect unpredictability might not be required for survival. In addition, variable behavior might serve a second function. Variable, spontaneous behavior is the only way to find out which portions of the incoming sensory stream are under operant control by the animal's behavior. If much of the variation in this stream is due to random noise (i.e., Gaussian), behaving in a non-Gaussian way may aid in the detection of those variations which can be brought under behavioral control. Given these considerations and that our data imply a memory for past events influencing behavior initiation, it is tempting to perceive such mechanisms of spontaneous behavior initiation as the basis for operant behavior, operant conditioning and habit formation

Flies are kept on standard cornmeal/molasses medium

Fly yaw torque behavior was recorded using a torque compensator

In the case that the feedback loop between the fly's behavior and its environment is open (i.e., ”open loop”), the arena is empty, stationary and thus supplying a visually constant environment (white light). The fly is stationary, providing for a stable environment in terms of volatiles (odours) and magnetic or electrostatic fields. Any potential auditory stimuli are uncontrolled and bear no correlation to the fly's behavior. An analog to digital converter card (PCL812; Advantech Co.) feeds the yaw torque signal into a computer which stores the trace (sampling frequency 20Hz) for later analysis. 13 flies from this condition form the group “

In addition to the ^{−10}Nm). This enables the fly to stabilize the panorama and to control its angular orientation. Each of the two groups contains the data from 13 flies. Only 30 minute-long uninterrupted flights in the respective situation are included in the analyses.

Observing the stored yaw torque traces after the experiment (

In free flight, fruit flies alter flight direction using rapid stereotyped turns termed body saccades ^{th} order Butterworth IIR, passband 6 Hz, stopband 9 Hz) to remove measurement noise, the zero-crossings of the gradient are detected. The time of the zero-crossing is qualified as a spike event if the peak amplitude falls above a given threshold and outside of a given refractory period after the last spike. The time between two successive spikes is stored as inter-spike-interval (ISI). For each detected spike, the direction (left-turning or right-turning) is stored as well (see

All our algorithms were also applied to computer-generated random ISI series. Standard stochastics predict the outcome of each algorithm for this group of ISI series, which thus provides a valuable control group. For each of the 13 animals from the

Releasing the restriction of a constant spike rate, we generated data using a doubly stochastic Poisson process (or _{i}_{i}_{i-1}

As a model for a more complex composite stochastic process we used a branching Poisson process (BPP)

In addition to ISI time series, we also computer-generated four categories of raw data traces for the nonlinear forecasting procedures:

_{i}

We chose _{0}

The state _{i}^{o}^{o}_{0} of an oscillator is randomly chosen in the interval [0,1]. We re-set _{i}^{o}^{−6} whenever it falls below this value.

The parameters ^{o}

Here, ^{o}_{i}^{o}

The model parameters ^{A}_{i}_{−1}+_{i}^{A}

In a stepwise fashion we tested increasingly more sophisticated models, eliminating the less complex models at each step.

The GRIP formalism has been developed to quantify the performance of random number generators

Here we apply GRIP to quantify the randomness of ISI sequences. In a first step, the ISI sequence (l_{1}, l_{2}, … l_{n}) is embedded in an _{i}, _{i+1}, _{i+2} the differences _{12} = _{i+1}−_{i} and _{23} = _{i+2}−_{i+1} are computed. The average inner product of these vectors has been shown to converge to a geometric constant _{d}

For an exponential probability density function ^{−al}_{d}

We compared ISI series to exponential distributions by first fitting an exponential distribution to the ISI series and then plotting the ISI series on a semi-logarithmic scale with the fitted exponential as a straight line. Wherever the ISI series deviates from the straight line, it deviates from an exponential distribution with the same rate.

If the distribution of ISIs of duration

Here,

To evaluate the possibility that the apparently random ISI sequences are produced by a nonlinear system causing chaotic dynamics we estimated the fractal dimensions of the underlying attractor of the sequences. Specifically, we computed the limit of the correlation dimension ν for an increasing dimensionality

_{d}_{1…m} are the embedded ISI sequence of dimensionality

_{d}

Here, _{i}

For random sequences the correlation dimension diverges. Since we observe convergence for our ISI sequences, we use this as another indicator that they are not trivially random. In order to exclude more complex stochastic processes, we compared the correlation dimension for each dataset with the values obtained from surrogate data. Surrogate datasets were created by randomly shuffling the ISIs of the measured sequence. This retains the first order statistics but destroys any dynamic information depending on the history of the system. If the correlation dimension of the measured sequence and the surrogate data differ significantly, we can conclude that the sequence contains dynamic information. To evaluate the difference we computed a normalized histogram of correlation dimensions of N = 1000 surrogate datasets. In this histogram, the value at the position of the correlation dimension of the measured sequence corresponds to the probability to obtain this value by a random sequence with the same first order statistics. These probabilities were averaged across individuals for each group.

To detect long-range correlations in our ISI series, we applied a method based on the root mean square (r.m.s.) fluctuation of displacement _{1}, l_{2}, … l_{n}) is a sequence of ISIs, the net displacement _{0}_{0}), and the statistical measure characterizing the series is the root of the mean squares

The angular brackets denote expectation value over all possible values _{0}

Uncorrelated time series yield α = ½, as do Markov processes for sufficiently large

Simplex projection

The method starts by embedding the ISI or data sequence in a

The resulting set of points in d-dimensional space is split in two halves, the library set ^{t}_{p}^{t}_{i}_{p}_{1} one step ahead is _{2}(

To generate a prediction for a vector ^{t}^{t}_{1}…^{t}_{d}_{+1}∈

A prediction ^{t}_{p}_{p}

Returning back from the embedding space to the temporal domain of the sequence, we consider the predicted ISI,_{p}

The coefficient of correlation between the sequence of predicted ISIs and the true values is then used as a measure for the prediction accuracy.

The S-map procedure (sequentially locally weighted global linear map ^{t}^{t}_{p}

As can be seen, the number of rows in

Function

For

As for the simplex projection, the accuracy of predictions is evaluated by the correlation coefficient between the predicted and the observed series.

To test for significant differences between several groups, we first used a Kruskal-Wallis ANOVA to test the hypothesis that all groups were drawn from the same population. If this hypothesis was rejected, 2-tailed post-hoc tests provided information as to the source of the differences. These tests were conducted for GRIP values (

Example yaw torque traces. Left column-total traces. Right column-magnified section from minutes 5-10 of the total traces. Red lines delineate enlarged sections. Upper row is from an animal flying in open loop in a featureless, white panorama (openloop). The middle row is from an animal flying in closed loop in a panorama with a single black stripe (onestripe). The lower row is from an animal flying in closed loop in a uniformly dashed arena (uniform).

(0.68 MB TIF)

Descriptive statistics of spiking behavior. A-The probability to perform consecutive spikes in the same direction. Random spike directions show equal probability for left and right turns, while fly data are dependent on the environmental situation of the fly. Flies fixate a single stripe and hence produce alternating spikes to keep the stripe in front of them. The onestripe group therefore is more similar to the poisson group than the other fly groups. Flies in uniform environments show persistent turning direction over several consecutive spikes. These spike trains in the same direction can be interpreted as search spirals. B-Total number of spikes. Openloop and poisson show the same values, because poisson was generated by drawing series with the same length as those in openloop. The onsestripe group shows fewer spikes, because of the long intervals flying straight towards the stripe.

(0.89 MB TIF)

Log-linear plots of fly and Poisson data. Corroborating the results from our GRIP analysis, exponential distributions (straight black lines) cannot be fitted to fly ISI series, whereas the poisson series shows the expected exponential distribution. Fly ISI series all show an excess of long intervals, suggesting a heavy-tailed distribution. See

(0.38 MB TIF)

Schematic diagrams of complex stochastic and simple nonlinear models. A-The branching Poisson process (BPP) as an example for complex stochastic models. The BPP consists of cascading units of filter functions and Poisson processes. Each unit's filter function receives the events from the Poisson process upstream and drives the rate of the Poisson process associated with it. The (unfiltered) output of all Poisson processes is combined to yield the total output of the model. B-The nonlinear automat is an example how simple nonlinear processes can generate complex behavior. The activator sends excitatory input to both turn generators. The turn oscillators inhibit each other. The output is the difference signal between the left and right turn oscillator. Each oscillator is described by a logistic map, and the coupling modulates the individual parameters of each map. See

(1.44 MB TIF)

S-Map analysis of all fly data and additional control series. A-S-Map analysis of ISI series. Depicted are the averaged results for the three fly groups. Interestingly, the fly group with a singularity in the environment (onestripe) can be clearly distinguished from the two groups with uniform environment (openloop and uniform). Note that the closed-loop groups (onestripe and uniform) also exhibit the nonlinear signature, excluding the possibility that the variability is an artefact of the constant stimulus situation in the openloop group. B-S-Map analysis of raw data series. At high parameter values, the logistic map shows the typical increase in forecast skill with increasingly nonlinear models, while the noisy sine function does not show any such improvement. The nonlinear agent (automat) with the originally published parameters behaves almost randomly, despite the nonlinear mechanisms generating the output. The fly data come to lie in-between the extreme control data, showing both an increase in forecast skill with increasingly nonlinear models and moderate overall correlation coefficients.

(0.42 MB TIF)

Tethered Drosophila. Tethered flying Drosophila can beat its wings, move its abdomen, legs and proboscis, but cannot rotate or otherwise move.

(1.94 MB AVI)

We are grateful to Martin Heisenberg, Randolf Menzel, Juliane Rama, Tilman Franke, Carsten Duch, Peter Wolbert, Anton Bovier and Randy Gallistel for critically commenting on an earlier version of the manuscript. We are especially indebted to Shu-Ju Tu and Ephraim Fischbach for assistance implementing the GRIP method and to Mark Frye for reminding BB of the main issue and thereby jump-starting this work. Gonzalo Garcia de Polavieja improved the manuscript tremendously by introducing us to the complex stochastic processes described by Cox, Teich and others.