Working demonstration Prepared for the continuous tracking study application

Time-lagged cross-correlation of dyadic tracking data: a running preview of the full pipeline


28 observers (14 Test / 14 Control) 6 target trials 168 dyadic analyses 1000 ms sampling lag window -5 s to +10 s 2688 coefficients computed
Summary

This page is a working implementation of the study's exact analysis design: 28 observers, each tracking 6 unique targets, giving 168 separate dyadic time-series analyses at a 1000 ms sampling interval. For every dyad it computes the zero-lag Pearson baseline, the full time-lagged cross-correlation function across a uniform -5 s to +10 s window stepped at every 1000 ms increment (exactly 16 distinct coefficients per trial, asserted in code), peak extraction, and a group-level linear mixed-effects comparison of Test against Control, reported in APA statistical style.

Why the data here is synthetic. The study's real tracking data is human-subject material, and it should not leave the research team before a contract and any required agreements are in place. So this preview runs on simulated dyads with a known ground truth built in: each synthetic observer tracks its target at a generating lag the pipeline does not get to see, and recovers it in 94.6% of the 168 dyads. Swapping in the real dataset changes the loader, not the analysis.
1

The lag grid: 16 coefficients per trial, by construction

The window runs from -5 s to +10 s inclusive, stepped at the 1000 ms sampling interval. That is (10 - (-5)) + 1 = 16 lags, and the pipeline asserts the count rather than trusting it. Positive lag tests whether the observer trails the target; lag 0 is the conventional baseline correlation.

seconds; lag 0 = zero-lag baseline. Hover any chip.

LAGS_S = np.arange(-5, 10 + 1) # 1 step = 1 sample at 1000 ms assert len(LAGS_S) == 16, f"Expected exactly 16 lags, got {len(LAGS_S)}" Lag grid (16 lags, seconds): [-5 ... 10] ✓ assertion passed Computed 2688 lagged coefficients (168 dyads x 16 lags); all dyads have exactly 16: True Peak-lag recovery vs. generating lag: 94.6% of 168 dyads
Don't take the page's word for it: this button recomputes every lagged Pearson r in JavaScript, from the raw traces embedded in this page, and diffs the results against the notebook's exported values.
2

Figure 1. Dyad explorer (interactive)

Every one of the 168 dyads is here. Pick an observer and a target trial: the left panel shows the raw 1000 ms traces, the right panel shows that dyad's 16-lag cross-correlation function with its peak circled. The Control group's story is the reason lagged analysis earns its keep: slower trackers look weakly synchronized at lag 0 and strongly synchronized at their true latency.

Observer Target
Test

Raw traces

Cross-correlation function

Zero-lag r (baseline)
.000
Peak r
.000
Peak lag
+0 s
Gain over baseline
+.000
Figure 1. Left: target (grey) and observer (group color) position traces, 120 samples at 1000 ms. Right: Pearson r at each of the 16 lags; open circle marks the peak. Hover either chart for values.
3

Figure 2. Group-level pattern across all 168 dyads

Averaging the 168 cross-correlation functions by group makes the design's hypothesis visible before any model is fit: the Test group's function peaks earlier and higher, the Control group's later and lower. At lag 0 the groups look far more different than they are at their respective peaks, which is precisely the zero-lag baseline's blind spot.

Test (n = 84 dyads) Control (n = 84 dyads)

Group-mean CCF (16 lags)

Peak r, every dyad

Figure 2. Left: mean cross-correlation at each lag, by group. Right: peak r for each of the 168 dyads (dots), with group mean and 95% CI (bar and whisker); the CI here is descriptive, the inference lives in Table 1's mixed-effects models, which respect the nesting of trials within observers.
Table 1. Linear mixed-effects models (statsmodels MixedLM, REML), random intercept per observer; 168 trials nested in 28 observers. Group effect = Test relative to Control.
Model (DV)bSEzp95% CI

Peak correlations are Fisher z-transformed before modeling. The latency model uses each dyad's peak lag in seconds. Both models converged; full summaries are in the notebook readouts.

This paragraph is assembled programmatically from the fitted models in the same run that drew the figures above: descriptives as M and SD, fixed effects as b, SE, z, p, and 95% CI, in APA 7 statistical style.

View the per-dyad results table (168 rows)
4

The deliverable this previews

Milestone 2 asks for a fully documented Jupyter notebook with code cells alongside execution readouts, plus a mirror production copy auto-exported as a standard Python script. That is exactly how this page was produced, so the deliverable format can be inspected now: