Estimating Location without External Cues

The ability to determine one's location is fundamental to spatial navigation. Here, it is shown that localization is theoretically possible without the use of external cues, and without knowledge of initial position or orientation. With only error-prone self-motion estimates as input, a fully disoriented agent can, in principle, determine its location in familiar spaces with 1-fold rotational symmetry. Surprisingly, localization does not require the sensing of any external cue, including the boundary. The combination of self-motion estimates and an internal map of the arena provide enough information for localization. This stands in conflict with the supposition that 2D arenas are analogous to open fields. Using a rodent error model, it is shown that the localization performance which can be achieved is enough to initiate and maintain stable firing patterns like those of grid cells, starting from full disorientation. Successful localization was achieved when the rotational asymmetry was due to the external boundary, an interior barrier or a void space within an arena. Optimal localization performance was found to depend on arena shape, arena size, local and global rotational asymmetry, and the structure of the path taken during localization. Since allothetic cues including visual and boundary contact cues were not present, localization necessarily relied on the fusion of idiothetic self-motion cues and memory of the boundary. Implications for spatial navigation mechanisms are discussed, including possible relationships with place field overdispersion and hippocampal reverse replay. Based on these results, experiments are suggested to identify if and where information fusion occurs in the mammalian spatial memory system.

x y θ , for random and thigmotactic trajectory at time step t is shown below.

Pseudocode begins
Randomly draw angular displacement if a viable next step had not been found. WN denotes a wrapped normal distribution. The thigmotactic trajectory model is suitable for any convex arena, but will deviate from concave boundary segments, and will not in general follow interior boundaries or barriers so cannot be considered a general movement strategy useful for idiothetic localization. It should also be noted that despite this algorithm being successful at generating thigmotactic trajectories, there was no boundary contact information per se available to the simulated navigation system.
In the random trajectory algorithm, there was a 10% probability of turning towards the arena centre when a boundary was reached, in order to traverse the entire arena. However, it should be noted that boundary contact or centre direction information was not available to the navigation system (particle filter) during idiothetic localization. At any time step t, the particle filter was only supplied with an egocentric noisy displacement estimate   ( )

S5
It should be noted that the thigmotactic trajectory algorithm was completely agnostic of whether the navigating agent was near the boundary or not. Therefore, the navigating agent need not directly sense the physical boundary to generate a trajectory which then allows successful idiothetic localization. Since the shape and size of the physical boundary affects the resulting trajectory, self-motion cues are necessarily affected by the boundary, and so it may be argued that the navigating agent indirectly received information about the physical boundary. However, that alone is not sufficient for idiothetic localization. For example, the trajectories used to simulate iPI and aPI in Fig 1A and 1B

S6
All arenas were scaled to preserve equal traversable area unless otherwise specified. The standard traversable area was equal to a circular arena of 76cm diameter, a commonly used arena for rodent experiments. Briefly, the shapes of the arenas used are described below.
• Kite -constructed by taking a 2:1 rectangle, split along the diagonal, reflecting one right triangular region, and re-joining the resulting pair of mirror-symmetric right triangular regions along the diagonal. A kite-shaped arena with two right angles is produced.
• T-maze -constructed by taking 5 equal square regions, concatenating 3 along the top, and 2 more down the midline of a T shape.
• Egg -equation from http://www16.ocn.ne.jp/~akiko-y/Egg/index_egg_E.html ≥ ≥ , and the long axis is the X-axis. The parameter ratios used were 0.9 b a = (Fig. 2C) and 0.7 b a = (Fig. 4A). The latter resulted in a more elliptic egg shape, and was used to make idiothetic localization using a standard random trajectory more difficult to clearly illustrate the improvement in localization performance due to thigmotaxis.
• Void landmark -a 14cm diameter circular void was centred 19cm from the circular arena centre.
• Asymmetric barrier -extended 25cm radially from centre of a standard circular arena.
When present, interior boundaries/barriers were also assumed to be in memory along with the outer arena boundary.

Particle filter pose distribution update using idiothetic path integration (iPI) only
The way in which the pose distribution was updated after each step is described, taking into account the uncertainty in the size and direction of the step.

At point ( )
, , x y θ in pose space, the small volume dxdydθ ideally contains ( ) ( ) , , , , n x y Np x y dxdyd θ θ θ = points, where N is the total number of particles, p is the true pose density function. In all particle filter simulations, 4 10 N = , which was found in earlier work to be adequate in representing dynamic pose distributions in which idiothetic self-motion, boundary memory and boundary contacts were combined nearoptimally in similar arenas [17] .

S7
The probability density function of the true egocentric displacement ( ) where 0 σ was estimated from the drift in HD cell tuning curves in darkness, and r σ was defined based on an estimated mean step length in darkness of 7cm, and using a liberal coefficient of variation of 0.2 [17] .
The mean forward speed for simulated foraging using idiothetic cues was 9cm/s. Importantly, the model assumed that the rotational error 0 σ was constant for the duration of all simulations, and that the modelled HD drift was independent of (hence received no feedback from) the particle filter. For convenience, angular parameters of (S2) and subsequent density functions were defined over the interval ( ) , −∞ +∞ , where all angles modulo 2π denote the same physical direction.
Following each step, the exact pose distribution in allocentric pose coordinates was given by: denotes the 4-quadrant arctangent function. In the particle filter model, the egocentric displacement of each particle was drawn randomly from the explicit calculations of the triple integral of (S3).

Particle filter pose distribution update using idiothetic self-motion cues and boundary memory
In the particle filter model, particles which crossed a boundary were culled, and remaining particles were randomly cloned to maintain a constant particle population. Importantly, the simulated agent did not have information about boundary contacts. For example, sharp turns were statistically more likely to be due to random turns within the arena than due to boundary contact (which it was unaware of).

S8
Some possible displacements may cross a boundary according to the map in memory. Using the boundary map, where η was a normalizing constant which ensured For simulating an animal of finite size (Fig. 4A), a hypothesized pose was deemed to have crossed a boundary if any part of the animal perimeter crossed the boundary. In the majority of arenas tested, crossing a boundary nearly always equated to exiting an arena. Frequently, a test for boundary exit could therefore replace a test for boundary crossing with little or no effect on performance. However, this approximation did not hold when the arena asymmetry was due to a zero-thickness asymmetric interior barrier (Fig. 3C).

Particle filter pose distribution update using idiothetic self-motion cues, boundary memory and boundary contact information
To fuse idiothetic self-motion, boundary memory and boundary contact information ( . For example, knowing that the boundary is precisely 5cm to the left means that the animal is somewhere along a line 5cm inside the boundary, without precise knowledge of where along a continuum of poses it may be.

S9
The conditional probability density function of the true boundary contact vector ( ) φ given an estimate where z r σ σ = and 0 φ σ σ = defined the error magnitudes of boundary contact information.
The pose distribution ( ) updated earlier using idiothetic self-motion and boundary memory information was refined further when boundary contact occurred (e.g., a form of allothetic localization in darkness, see Fig S2a and Ref [17] ). The Bayes-optimal pose distribution given boundary contact information is given by to any boundary point, and t φ is the angle measured from 1 t θ + to that closest boundary point. In the particle filter model, each particle was assigned a weight

Retrospective localization
There are multiple Bayes-optimal strategies in which localization using self-motion and boundary memory can be improved retrospectively [49] . Two strategies are demonstrated using a particle filter implementation -the first is an 'offline' reverse replay strategy, and the second is an 'online' backward inference strategy.
By using memory, both strategies can be considered as passing information backward in time to improve an earlier estimate of pose. Their principles are explained using their particle filter implementations, assuming that the aim is to improve the estimate of pose at time 0. In the first strategy (e.g., Fig 5, Fig S5), the final particle cloud at time t is treated as the initial pose estimate. Then the self-motion cues are replayed in reverse as input to the standard particle filter, running from t to 0. Assuming that localization improved between time 0 and t, then the pose estimate at time 0 also improves following reverse replay. A S10 disadvantage of this strategy is that the sequence of self-motion cues has to be stored first (from time 0 to t).
An advantage is that any pose estimate between 0 and t can be recovered during reverse replay.
In the second strategy (e.g., Fig S5), each particle is associated with two poses: the current pose (which is updated as per the standard particle filter) and the original pose at time 0 (which is not updated). Assuming that localization improved between time 0 and t, the total number of unique poses corresponding to time 0 will be reduced, since some particles will have no descendants. In this way, the pose estimate at time 0 can be recovered from the time 0 pose record of the descendant particles at time t. A disadvantage of the second strategy is that only a separately stored pose snapshot can be updated (e.g., time 0), and which has to be decided prior to the availability of subsequent localizing information. An advantage of the second strategy is that updating is done 'online' without the need to store a sequence of self-motion cues. Alternatively, if the sequence of self-motion cues is stored (as per reverse replay), then a 'forward replay' of the sequence can begin at an arbitrary time, still using backward inference to retrospectively recover its pose. This alternative implementation avoids the need to decide the time for which to recover the pose prior to all information being available.
These two replay strategies may be considered as examples of 'beta recursions' and 'gamma recursions' respectively (for formal mathematical descriptions, see [49] ). The two procedures yielded similar performance results (Fig S5, Text S1 -Supporting Results).

Continuous and intermittent compass use
The effect of using an allothetic compass continuously during path integration only (aPI, Fig. 1), and using an allothetic compass intermittently with a boundary map (stochastically, on average once every 30s, Fig.   S4) were included for comparison. In both cases, the allocentric direction estimation error was assumed to be an unbiased Gaussian random variable, with 0 compass σ σ = .

Place stability index, I p
The place stability index, I p , was defined to measure a positional distribution's instantaneous accuracy and In arenas with n-fold rotational symmetry, the corresponding I p value tended to be low since even without noise, there were n true poses which could not be distinguished, having identical corresponding boundary representations. An adjusted I p * value was therefore defined using n rotational clones of the true pose. Both

Circular variance in pose direction estimate, V(θ)
The instantaneous direction of the particle cloud was calculated as the circular mean of the particle directions, i.e., where j α denotes the allocentric direction of particle j, and where  k θ was the instantaneous directional estimate of the particle cloud of trial k found using (S11), and TRUE k θ was the instantaneous true direction of trial k. Note that the circular variance is independent of net directional bias and cannot be used to quantify the instantaneous net deviation of a single particle filter's direction estimate from the true direction. However, across all random simulation trials, the net deviations were unbiased and the circular variance therefore reflected the magnitude of directional error. Consequently, S12 ( ) V θ is a measure of the spread of best direction estimates around the true direction across trials, rather than a measure of an individual particle filter's directional accuracy or precision.

Grid cell spike simulation
A simple spiking neuron simulation was used to test whether the particle filter's pose estimate was capable of maintaining a stable representation of position similar to the firing fields of cells in the mammalian hippocampal-entorhinal space circuit. To maintain a multimodal grid field requires a higher level of spatial specificity than a unimodal place field. The finest grid spacing observed in vivo is approximately 30cm [13,18] , which would be the most difficult grid to resolve spatially in the presence of positional uncertainty.
This was chosen as the simulated grid spacing to test localization performance.
Spike probability following each step was modelled as cm for all standard arenas, and 5 grid σ = cm for simulations using 2-fold standard grid spacing (Fig S3B, S4B). The spike probability decreased monotonically from unity according to the distance j r between the positional centre of mass of the particle cloud ( ) were defined explicitly to be at the grid points of a tessellating hexagonal grid. The phase and orientation of ideal grid points were empirically adjusted to include at least three points inside each arena. Ideal adjacent grid positions were 30cm apart for all arenas except the enlarged arenas of Fig S3B and S4B where a 60cm grid spacing was used. The simulated spikes from all trials were pooled to provide a single representation of the spatial specificity which could be expected over many random trajectories within an arena.
A gridness index (Table S1) was found using the autocorrelogram of the firing rate map [19] . Where grid modes were indistinct, a circular annulus mask was used with inner radius 0.5x, and outer radius 1.5x the ideal grid spacing.
The spikes corresponding to the three modes with the highest total spike count were further analysed using methods developed for place fields (Table S1). The maximum likelihood factorial model [20] was used to find a mode's spatial and direction information content. This analysis provided a measure of the timeaveraged spatial specificity achieved in three different locations of each arena, correcting for possible direction-dependence. The standard spike and position histogram bin sizes used were 2.5cm x 2.5cm for S13 position and 6° for direction. For simulations using 2-fold standard grid spacing, bin sizes of 5 cm x 5 cm x 6° were used.

Test of point density uniformity in an arena
Test of point density uniformity (Fig S3B) was performed by taking the voronoi mesh polygons (of spike positions) which were completely within the arena boundary, and comparing their area distribution against an equivalent area distribution obtained from an equal-size random sample of points uniformly distributed in the same arena (Kolmogorov-Smirnov test).

Test for equal circular concentrations
The κ-test is a parametric two-sample test to determine whether two circular concentration parameters are different, assuming the direction samples arise from von Mises distirbutions [51] . The test was implemented as circ_ktest in the Circular Statistics toolbox for Matlab [52] .

Kinetic time constant
The duration t 90 was defined as the time (minutes:seconds) taken for the median I p to undergo 90% of the total increase (or decrease) over 48 minutes.

Arena rotational asymmetry
The rotational symmetry of an arena was determined by rotating through 360°. If a rotated arena is identical to the unrotated arena only once through the rotation, i.e., at 360° (≡0°), then it has 1-fold rotational symmetry (abbreviated as 1-RS here). For example, ellipses and rectangles have two rotation angles (180° and 360°) where they are identical to the unrotated arena, hence have 2-fold rotational symmetry (2-RS).
An arena rotational asymmetry function (Fig. 3B, left) was found by rotating an arena around its centre of mass, overlaid on the original arena. Asymmetry was calculated as the normalized non-overlapping area (between 0 and 1). In arenas with n-RS (n>1), there are n zero-points in the asymmetry function. The mean asymmetry over 360° was used in Fig 2b (right). It should be noted that this function did not account for trajectory-dependent inhomogeneity in arena sampling, or crossing of interior boundaries (Fig. 3C).

Effects of matched and mismatched noise magnitude on idiothetic localization
Increasing either the magnitude of angular (Fig. S1A) or linear (Fig S1B) displacement estimation noise resulted in a significant deterioration in idiothetic localization performance.  P I values were inversely related to the magnitude of both types of noise (Fig. S1E). These results occurred despite the navigation system matching the true noise distribution during particle filter update, showing that the effects on performance were directly attributable to the level of noise in the estimate of self-motion. Under all 'matched noise' conditions, >91% of P I values remained above chance after 48 minutes. Similarly, >76% of  TRUE θ θ θ = − (error in pose direction estimate) remained within ±45° of the true heading. These results are consistent with the fact that even at the highest levels of matched linear or angular noise, individual grid modes showed moderate to high spatial information content (>1.2 bits/spike, Table S1 -S1A, S1B). Therefore, although a multimodal firing field may not be evident (gridness indices <0.3), unimodal firing patterns similar to that of place fields may still be possible under these conditions. Next, the magnitude of angular or linear noise was under-or over-estimated by the navigation system, while maintaining the same baseline level of true angular and linear noise (Fig. S1C, S1D underestimation of angular noise can therefore cause deterioration in idiothetic localization performance, despite successful initial localization. In contrast, overestimation of errors reduced  P I but resulted in a smaller V(θ). The latter may be attributed to the reduction of gross localization errors which sporadically occurred due to the use of a finite particle cloud population to model a continuous distribution. Overall, the results suggest that underestimation of self-motion noise increases the frequency of large idiothetic localization errors. The relatively high spatial information content (>1.6 bits/spike) and relatively low directional information content (<0.2 bits/spike) of individual grid modes, together with the gridness index (>0.25), show that both unimodal and multimodal firing patterns can be sustained despite mismatched selfmotion noise (Table S1 -S1C, S1D).

S15
Taken together, these results show that while the magnitude of angular and linear noise affected localization performance, idiothetic localization is still possible despite a mismatch between the true noise parameters and that used by the navigation system.

Intermittent use of boundary contact information
During periods with additional boundary contact information (Fig. S2A & S2B, yellow bars),  P I increased and V(θ) decreased. Conversely, following cessation of use of boundary contact information (Fig. S2A &   S2B, orange bars),  P I decreased and V(θ) increased. Having initial pose information (oriented) was associated with a small but statistically significant residual increase in  P I at 40 and 48 minutes, with and without intervening periods of using boundary contact information (Fig. S2A, right). In contrast, the difference in  ( ) 40 P I was not statistically significant (Bonferroni correction for family-wise type I error), comparing with or without a history of two 8-minute periods of using boundary contact information. These results suggest that quality of initial pose information may have a greater residual effect on localization performance than intermittent allothetic boundary contact information. Commensurate changes in properties of simulated firing patterns were evident (Fig. S2B, Table S1).

Effects of arena size on idiothetic localization
A 4-fold increase in the kite arena area (Fig. S3A) resulted in a lower  P I (right, Wilcoxon test, p=1.4x10 -12 ) and higher V(θ) (κ-test, p<10 -16 ) at 48 minutes, showing that localization performance was affected by arena area. There was a commensurate decrease in the spatial specificity of simulated grids. At the standard grid scale, no grid modes were detected (Fig. S3B, left, spike uniformity test, p=0.60). This was partially rescued by doubling the grid spacing (Fig. S3B, 2nd from left, spike uniformity test, p<10 -16 ). The crosscorrelogram between the grid fields of the standard and scaled large arena (Fig. S3B, right) showed the overall grid pattern was preserved despite a less distinct grid in the large arena. These results suggest the boundary's effect on idiothetic localization is reduced in large arenas, and performance may be poor.

A comparison of two retrospective localization procedures
Two retrospective localization procedures were implemented using the particle filter model described earlier. One was an 'offline' reverse replay procedure, the other an 'online' backward inference procedure, sharing the common feature that future self-motion information is used retrospectively to improve the S16 estimate of pose (detailed in Text S1 -Modelling and Analysis). In a comparison study (Fig S5), both procedures were used to obtain the pose estimate at time 0 using the same environment and assumptions as Fig 5. Due to the large number of particles culled during 'online' backward inference, 10 6 particles were used for all simulations in this comparison. Starting from full disorientation, both procedures yielded a significant retrospective increase in  P I at time 0 (Wilcoxon signed rank test, p<10 -100 for both procedures, n = 10 3 ), demonstrating that both procedures successfully utilized future self-motion information to improve a past pose estimate. The  P I using 'offline' reverse replay was marginally higher than 'online' backward inference (0.89 and 0.88 respectively, Wilcoxon rank sum test, p=0.003). However, the error distances between true position and estimated position at time 0 were not significantly different between the two procedures (mean±s.d., 'offline' reverse replay: 12.7±12.3 cm, 'online' backward inference: 12.8±11.2 cm, Wilcoxon rank sum test, p=0.12, t-test, p=0.76). Taken together, these results demonstrate that at least two distinct particle filter implementations of retrospective localization can be used to recover a pose from whence a navigating agent was fully disoriented, and without using allothetic cues.