This static export is derived from the real tracking tables and saved R/brms v2 posterior fits. It is not simulated data, a browser refit, or an export of the Python/PyMC fit.
jgraving/unwrap: a88980215555a0169483aad7fbf6ac826b7121dbjgraving/unwrap-data: 211be00604093b2c6c8f441efd5fb27f4a6b361agoldshtein_bats/dataAll_trackDest.xls, all_bats_info.xls, and agamon_hula_lake_outline.geojson.fit_cache/bats_fit_vm_v2.rds, fit_cache/bats_fit_mix_v2.rds.notebooks_r/goldshtein_bats.ipynb (comparison output in cell index 48).Full source file SHA-256 digests are included under provenance.sha256 in the JSON. The site exporter is scripts/export_goldshtein_bats.py.
Use local checkouts at the pinned commits, with Python dependencies numpy, pandas, scipy, rdata==1.1.0, xlrd, geopandas, pyproj, shapely, and tqdm. Pandas 2.2/2.3 and xlrd 2.0.1 are sufficient.
python scripts/export_goldshtein_bats.py --unwrap /path/to/unwrap --data /path/to/unwrap-data
node --test tests/goldshtein-bats.test.cjs
The exporter uses the upstream 60 m resampling and harmonic lake-reference preprocessing. It checks the retained tag order, treatment, and circular response against both cached fitting tables. All 4,942 headings match; the maximum pre-rounding angular difference is about 2.83e-10 radians. No sampling settings, priors, or fits are changed. R environments are never executed. The narrow rdata sentinel compatibility adapter is explained in the script.
Coordinates are UTM EPSG:32636, in meters. Angles are radians with 0 north and positive clockwise unless noted otherwise. angles is a 145-point relative-bearing density grid on [-pi, pi], including the repeated endpoint.
Each track contains id, one-based treatment, destination (roost/lake), number of usable headings n, points, and fits.vm/fits.mix.
Point columns, in order:
Missing quantities are JSON null. Every resampled position is retained for mapping; only usable headings enter histograms and the heading selector. Gaps are dashed. The original fitted table includes some gap-crossing bearings; those are retained and identified, not silently dropped.
mu, kappa, and weight contain [5th percentile, median, 95th percentile]. mu is in degrees, unwrapped about its circular posterior mean before taking quantiles. density contains [5th-percentile curve, posterior-mean curve, 95th-percentile curve]. goal is the mean weighted directed density, and background is the mean uniform density. Both components sum to the mean total density. All summaries use all 8,000 retained posterior draws, four chains of 2,000 draws with zero saved warmup. Densities are per radian.
population uses treatment effects with individual effects set to zero. It does not integrate over a new-animal distribution. Individual summaries include that animal’s fitted effects. loo copies the saved notebook’s PSIS-LOO table; it is not a new LOO calculation.
Original study: Goldshtein et al. (2024), Acoustic cognitive map-based navigation in echolocating bats, Science 386(6721), 561–567. https://doi.org/10.1126/science.adn6269
python scripts/export_bat_directedness.py --data /path/to/unwrap-data generates goldshtein-bats-directed.20261111.json (schema version 2) from all 8,000 saved mixture draws. Its SHA-256 identifies the paired base export. For each draw, logBF = kappa * (cos(theta - mu) - 1) - log(i0e(kappa)), r = logistic(logit(w) + logBF), and q = logistic(logBF). The map, selected-step readout and history plot show mean q, called Posterior directedness, on the same fixed 0–1 scale with neutral midpoint .5. They always use the mixture fit. Raw step probabilities remain in the data for reproducibility but are not rendered in those views.
Each sidecar track has id, baseline = [5th percentile, mean, 95th percentile] of w, and steps aligned with every base position. Step columns remain [r05, r95, q05, qMean, q95, Pr(logBF > 0)]. Non-fitted positions are null. Transformations precede posterior averaging; the exporter checks mean r against the base export to within 1e-6.
onsets maps BF-threshold/run-length keys (thresholds 1,2,3; lengths 3,5,10) to sparse integer counts = [[zero-based recorded-position index, number of draws]], none = no qualifying run count, and boundary = count with a start immediately following a missing/gap heading or at the recording boundary. Counts plus none equal exactly 8,000. Boundary is a subset of qualifying counts, not an additional outcome.
For each JOINT posterior draw the exporter finds the first run of n usable, non-gap headings with logBF > log(threshold) and cos(theta)>0. It retains the same draw throughout a flight. Missing, away, gap and below-threshold headings reset the run. The displayed onset PMF divides counts by ALL 8,000 draws, while the median and central 90% equal-tail interval condition on qualifying draws. No-bout and boundary probabilities remain explicit. The map shows posterior location mass with gold halos, the conditional interval as a wide path highlight and the median as a ring. The history shows the evidence interval and a separate candidate-start PMF, not a raw membership trace.
Share version 2 uses validated e=1/2/3 and n=3/5/10. Old support-level u parameters are ignored; old links retain bat, destination, model, heading and run-length settings with the default evidence ratio threshold. The old v1 sidecar remains available for cached pages.
These are posterior summaries of a descriptive threshold functional, not a fitted temporal change-point or decision-time posterior. Intervals are conditional on threshold settings and the saved model; they exclude uncertainty about those choices, omitted temporal processes and tracking error. Qualifying bouts can end. Lake approaches are not roost homing. Existing diagnostic qualifications still apply.
Validate with python scripts/test_bat_directedness.py and node --test tests/goldshtein-bats.test.cjs.
The homepage card remains hidden. Do not reintroduce its current-research entry.
python scripts/export_bat_onset_sliders.py --data /path/to/unwrap-data creates goldshtein-bats-directed.20261111-sliders.json (schema 3) from all 8,000 joint mixture draws. The sliders evaluate posterior directedness strictly greater than 0.50–0.95 at increments of 0.01, sustained for 1–20 consecutive usable goalward headings. Each draw remains intact across a trajectory; gaps, missing headings, away-facing steps and below-threshold steps reset the run. These remain descriptive onset rules, not inferred decision times.
For each bat, sliderOnsets.index[(percent - 50) * 20 + run - 1] selects a distribution in sliderOnsets.distributions. Identical distributions are deduplicated without rounding counts or approximating the posterior. Each distribution retains 8,000 outcomes including no-bout draws and the subset of starts at recording/gap boundaries. Original schema-2 summaries are retained for reproducibility. All shared 0.50 and 0.75 settings exactly match the original exporter. Version-3 shared links use integer q (percent) and n (steps); legacy ratio links map to the nearest supported directedness setting (BF 2 becomes 0.67).
The posterior mean weighted directed and undirected densities add to the posterior mean total density. The uncertainty band belongs to the total, and observed headings sit on a separate peripheral ring. No Cartesian density plot duplicates this figure.
The polar PDF uses a nonzero inner radius as the zero-density baseline. All weighted components, their sum, and the posterior band share the transform r = inner + density / maximum * (outer - inner). Add the components’ radial increments above the inner ring, not their absolute radii. The route, polar density, history, controls, and playback share one explorer surface.
python scripts/export_bat_smoothing.py --data /path/to/unwrap-data verifies the exact R/brms mixture-fit SHA256, reads all 8,000 joint draws, and generates bat-smoothing.20261112/window-{2..20}.json. Window 1 uses the unchanged schema-3 file. The exporter verifies all 61,640 original onset settings and the original step summaries at window 1 before writing the additional windows.
For each posterior draw, first compute q = logistic(log f_VM − log f_uniform), then take the arithmetic mean of q at the current and up to W−1 preceding valid steps. No future steps enter a window. GPS positions, spatial spacing, observed headings, and the trajectory geometry are unchanged. At segment starts use the available shorter window; missing and gap-crossing headings reset it. Gap-crossing headings retain their raw score for inspection and are never used in windows or onset runs. Away-facing valid steps remain in the average; onset eligibility still requires each qualifying heading to be goalward. The onset rule operates on the averaged q, strictly above the threshold for the selected consecutive-step count, and returns the first step of that qualifying run. This is the start of the run, not its later confirmation step or the beginning of its smoothing window.
Each schema-4 file contains its window, draw count, base-data SHA256, and all 67 bat IDs. Its steps align with base positions and contain [q05, qMean, q95, Pr(q > .5)] of the windowed scores. Missing positions are null. sliderOnsets keeps the schema-3 index/distribution format and exact integer counts, including no-bout and boundary outcomes. The browser combines these four columns with the unchanged raw responsibility interval only for schema compatibility; raw responsibilities are not smoothed or displayed as the score.
Posterior means and quantiles are calculated after averaging within joint draws, never by smoothing credible-interval bounds. Map colors, polar-dot colors, the directedness marker, and the time series use the same active window. The onset PMF, conditional median/90% interval, boundary probability and no-bout probability use that window too. The fitted density and component weights are unchanged. Smoothing can delay or change onset and remains a sensitivity parameter; the posterior intervals do not integrate uncertainty over the window choice. v4 share links retain s (1–20); legacy links default to 1.
export_bat_heading_key.py verifies the original mixture-fit hash and exports all 8,000 draws at the same 145 goal-relative angles as the density plots. goldshtein-bats-heading-key.20261112.json stores per-angle q05, qMean, q95 and the posterior mean unweighted von Mises density for each bat. The uniform component density is 1/(2π). The circular key uses qMean and the exact selected heading’s unsmoothed score. It explains the heading-level model and therefore does not apply along-flight averaging to arbitrary angles. The main map, polar observation dots, and history retain the selected trailing window. The small component curves share a common linear density scale; arrow arrangements are schematic.
Fresh visits now default to a ten-step window. Explicit shared s settings are preserved, and legacy model links without s keep their one-step results.
The active bat-smoothing.20261112-recency/window-{2..20}.json files replace equal weights with normalized exponential weights (1-alpha)^age, where alpha = 2/(1+sqrt(W)). The selected window remains a maximum of W trailing steps. This shortens the effective span: at W=10 the current step receives about 48% of the weight and the mean lag is about 1.1 steps, versus 4.5 for the old boxcar. It reduces jump size while following sustained changes sooner. It does not guarantee unchanged onset estimates.
The exporter still applies weights within each of the same 8,000 joint draws before calculating posterior intervals, threshold runs and all onset outcomes. Partial windows are normalized; missing/gap resets, raw gap inspection, goalward eligibility and exact window-1 results are preserved. Schema 4 adds method exponential-recency and alpha. Original equal-weight assets remain available for cached pages. GPS and fits remain unchanged.