Recurrence Quantification Analysis of a GRU Autoencoder's Learned Climate Embedding

A GRU autoencoder's climate embedding, tested for seasonal structure with joint recurrence plots and surrogate significance testing.

A GRU autoencoder compresses 14-day windows of Delhi daily climate data (temperature, humidity, wind speed, pressure, and a cyclically encoded date) into a 32-dimensional embedding per day. The question is not whether it reconstructs well, but whether the embedding encodes the seasonal cycle rather than an arbitrary compression of the inputs. Recurrence plots and joint recurrence provide the analysis, Takens' delay-embedding theorem motivates one experiment, and surrogate testing with Bonferroni correction assesses significance. Result: joint recurrence between the embedding and the raw inputs is significant for humidity, wind speed, and date, but not for pressure and temperature, despite their higher JRR/chance ratios.

Independent Research · 2026 · PyTorch, Matplotlib, Pandas, Kagglehub

The embeddings trace an annual loop in the first two principal components (~58% combined variance), with the months in order · Open full resolution

Method

Data and model. Four climate variables plus a sin/cos encoding of day-of-year (so Dec 31 and Jan 1 sit next to each other) form a 14-day rolling window. A GRU encoder compresses each window to a 32-dimensional hidden state; a GRU decoder reconstructs all 14 days from that state alone. Windows are stride-1 and chronological, so the day-by-day embeddings form a trajectory through 32-dimensional space (~1449 points).

Raw daily climate series, 2013–2017, train/test split · Open full resolution
Cyclical day-of-year encoding, colored by month · Open full resolution

Why recurrence. Recurrence plots (Eckmann et al., 1987) were used instead of Lyapunov exponents or full attractor reconstruction because they work on short, noisy real-world data without choosing an embedding dimension or delay; they need only pairwise distances and a recurrence threshold (set here so the embedding's recurrence rate is 5%).

Statistical controls.

Results

1. PCA. The embeddings trace an annual loop in the first two principal components (~58% combined variance), with the months in order around it (pictured above). This is suggestive, not conclusive.

2. Joint recurrence. JRR/chance: date 7.25×, pressure 2.71×, temperature 2.47×, humidity 1.69×, wind speed 1.38×. Read on its own, this suggests date dominates the embedding's learned structure.

Joint recurrence grid for all 5 variables, with surrogate p-values · Open full resolution

3. Date ablation. Retrained without date as an input, the JRR/chance against true date drops from 7.25× to 4.91× (lower, but still well above 1×), and the annual loop in the PCA largely disappears. Seasonal information therefore remains in the embedding without the date input. This is consistent with Takens' theorem but does not require it: the climate variables, temperature in particular, are seasonal on their own.

PCA, with vs. without date input · Open full resolution
Joint recurrence vs. true date, with vs. without date input · Open full resolution

4. Surrogate testing. After Bonferroni correction, only humidity (z=5.88), wind speed (z=5.69), and date (z=2.15) stay significant (p = 0.00498 each, the minimum attainable with 200 surrogates, against α = 0.01). Pressure and temperature, despite larger raw ratios, do not survive (p = 0.0149 and 0.0299). Possible reasons: pressure's recurrence structure is patchy and event-clustered (note the spikes in its raw series), which inflates its null variance; temperature, like date, is strongly periodic, and for a periodic variable many shifted copies still partly phase-match, widening the null. The same effect would explain date's low z-score.

Joint recurrence between the embedding and the raw inputs is significant for 3 of 5 variables: humidity, wind speed, date. Ratio size and statistical significance disagree here, and the "date is the standout" reading does not hold: date remains significant, but with the smallest z-score of the three.

Robustness

An audit found the Theiler exclusion was one day wide instead of 14 days, inflating early numbers. Before fixing it, the window was swept across five sizes (0, 1, 14, 30, 60 days): rankings and rough magnitudes held at every size, only the exact values moved (date 7.81× → 7.25×). Two more bugs (a leap-year phase error in the date encoding, and an unseeded RNG) were fixed the same way, and every result was regenerated and reproduced bit-for-bit.

Summary

Recurrence plots, joint recurrence, and a Takens-motivated ablation indicate that the embedding encodes the seasonal cycle. Surrogate testing with Bonferroni correction overturns the naive reading of the ratios: humidity, wind speed, and date hold up statistically, while pressure and temperature, despite higher ratios, do not.