[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-116269":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":8,"language":10,"languages":8,"totalLinesOfCode":8,"stars":11,"forks":12,"watchers":13,"openIssues":12,"contributorsCount":12,"subscribersCount":12,"size":12,"stars1d":14,"stars7d":15,"stars30d":15,"stars90d":12,"forks30d":12,"starsTrendScore":16,"compositeScore":17,"rankGlobal":8,"rankLanguage":8,"license":8,"archived":18,"fork":18,"defaultBranch":19,"hasWiki":20,"hasPages":20,"topics":21,"createdAt":8,"pushedAt":22,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":12,"starSnapshotCount":12,"syncStatus":26,"lastSyncTime":27,"discoverSource":28},116269,"Exact-Temporal-Range-Queries-through-Local-State-Windows","OliverDOU776\u002FExact-Temporal-Range-Queries-through-Local-State-Windows","OliverDOU776",null,"https:\u002F\u002Foliverdou776.github.io\u002FExact-Temporal-Range-Queries-through-Local-State-Windows\u002F","Python",94,0,53,15,37,57,76.2,false,"main",true,[],"2026-11-10 15:06:21","2026-11-23 20:14:37","\u003Cdiv align=\"center\">\n\n# Exact Range-Count Envelopes\u003Cbr>Over Ordered Time Series\u003Cbr>Under Total-Variation Drift Budgets\n\n\u003Cp>\u003Ca href=\"mailto:zijia.wang18@imperial.ac.uk\">Zijia Wang\u003C\u002Fa> · \u003Ca href=\"mailto:c.toumazou@imperial.ac.uk\">Christofer Toumazou\u003C\u002Fa>\u003C\u002Fp>\n\nCentre for Bio-Inspired Technology, Department of Electrical and Electronic Engineering\u003Cbr>\nImperial College London, London, United Kingdom\n\n**One time series. One total-variation drift budget. Exact count envelopes.**\n\n[Paper](docs\u002Fassets\u002Fpaper.pdf) · [Project page](https:\u002F\u002Foliverdou776.github.io\u002FExact-Temporal-Range-Queries-through-Local-State-Windows\u002F) · [Try your data](https:\u002F\u002Foliverdou776.github.io\u002FExact-Temporal-Range-Queries-through-Local-State-Windows\u002Fdemo\u002F) · [Run the code](#quick-start) · [Method](#method) · [Results](#results) · [BibTeX](#citation)\n\n\u003C\u002Fdiv>\n\n\u003Cp align=\"center\">\u003Ca href=\"https:\u002F\u002Foliverdou776.github.io\u002FExact-Temporal-Range-Queries-through-Local-State-Windows\u002F\">\u003Cimg src=\"docs\u002Fproject\u002Fopening-film.gif\" width=\"800\" alt=\"Opening film: a glucose sensor under the skin reports 96 readings; each reading fills one well of a 96-well plate; over offset paths with total variation at most 4 the number of readings in the 70 to 140 mg\u002FdL band ranges from exactly 63 to exactly 92.\">\u003C\u002Fa>\u003C\u002Fp>\n\n\u003Cp align=\"center\">\u003Csub>96 public BIG001 glucose readings, one per well. As recorded, 84 lie in the TITR band [70,140] mg\u002FdL; over every integer offset path in −30…30 with total variation at most 4, the count is at least 63 and at most 92. The film subtracts offsets (g\u003Csub>i\u003C\u002Fsub> − x\u003Csub>i\u003C\u002Fsub>), as the browser tool does; on this symmetric domain that is the paper's g\u003Csub>i\u003C\u002Fsub> + δ\u003Csub>i\u003C\u002Fsub> model with x\u003Csub>i\u003C\u002Fsub> = −δ\u003Csub>i\u003C\u002Fsub>. Skin, sensor and plate are schematic; the trace, offset paths and counts are computed from the data (\u003Ca href=\"docs\u002Ffigures.md#project-page-opening-film\">details\u003C\u002Fa>, \u003Ca href=\"docs\u002Fproject\u002Fopening-film.mp4\">MP4\u003C\u002Fa>).\u003C\u002Fsub>\u003C\u002Fp>\n\nThreshold-count and range-proportion queries, such as time in range (TIR) and time in tight range (TITR) for continuous glucose monitoring (CGM), are usually evaluated on the readings as recorded. Calibration bias and drift, however, perturb a sensor smoothly over time. **LocalWindows** is an exact query operator that returns the minimum and maximum attainable threshold counts when every reading may be shifted by an integer offset and consecutive offsets share a total-variation (TV) budget, for a whole bank of budgets at once. This repository contains a Python implementation, a native C++ driver with the paper's exact baselines, an in-browser query tool and the paper.\n\n## Run an exact query\n\n**[Try your own data →](https:\u002F\u002Foliverdou776.github.io\u002FExact-Temporal-Range-Queries-through-Local-State-Windows\u002Fdemo\u002F)**\n\nThe browser tool lets you:\n\n1. **Paste readings or upload a CSV**, with optional 0\u002F1 row weights.\n2. **Set the band, integer offset domain and shared movement (total-variation) budgets.**\n3. **Compute exact minimum and maximum counts**, then download the result as JSON.\n\nIt supports exact decimal predicates, up to **2,000 rows**, **401 integer states**, and budgets **0–64**. Inputs stay in your browser, with no external upload. [Input format and worked walkthrough](docs\u002Fdemo.md) · [Video\u002FGIF guide](docs\u002Fdemos\u002FREADME.md)\n\nCheck the browser solver independently with `node tests\u002Ftest_browser_solver.cjs` (320 exhaustive small cases plus fixed public and decimal-boundary checks; no dependencies).\n\n\u003Cp align=\"center\">\u003Ca href=\"https:\u002F\u002Foliverdou776.github.io\u002FExact-Temporal-Range-Queries-through-Local-State-Windows\u002Fdemo\u002F\">\u003Cimg src=\"docs\u002Fdemos\u002Fpublic-session.gif\" width=\"900\" alt=\"Actual browser recording: load 96 public readings, change offset constraints, recompute exact bounds and export the query.\">\u003C\u002Fa>\u003C\u002Fp>\n\n## Using the browser tool\n\nThese screen recordings show the browser application in use: entering data, changing a query, inspecting exact counts and downloading the query with its results. Each session demonstrates a complete task.\n\n| Task | What the session shows | Recording |\n|:--|:--|:--|\n| **Paste data, compute and export** | Paste two readings, compute budgets 0 and 1, edit a reading, recompute and download JSON. | [MP4](docs\u002Fdemos\u002Fcsv-session.mp4) · [GIF](docs\u002Fdemos\u002Fcsv-session.gif) |\n| **Check a public glucose report** | Load 96 public BIG001 readings, inspect five budgets, narrow the allowed offsets and export the revised report. | [MP4](docs\u002Fdemos\u002Fpublic-session.mp4) · [GIF](docs\u002Fdemos\u002Fpublic-session.gif) |\n| **Report selected readings** | Import a five-row CSV with a 0\u002F1 count mask, keep temporal order, add a budget and export. | [MP4](docs\u002Fdemos\u002Fmasked-session.mp4) · [GIF](docs\u002Fdemos\u002Fmasked-session.gif) |\n\n[Session steps, example files and data attribution](docs\u002Fdemos\u002FREADME.md).\n\n## Two readings explain the problem\n\nTake readings **70 and 141 mg\u002FdL**. Count how many corrected readings fall in the closed band **[70,140]**. In the browser tool and the Python API, **corrected reading = glucose − offset**; here each offset is 0 or 1.\n\n- **Budget 0:** either constant offset gives exactly **one hit → [1,1]**.\n- **Budget 1:** offsets **(0,1)** give two hits; **(1,0)** give zero → **[0,2]**.\n\nThe budget limits **total movement across the sequence**. It is shared by all rows. Zero movement permits any constant offset in the domain. The paper writes the same model as a perturbed reading $g_i+\\delta_i$; subtracting $x_i=-\\delta_i$ is that model with the offset domain reflected, so on a symmetric domain $\\{-R,\\ldots,R\\}$ both forms give identical envelopes.\n\n## The same query on real observations\n\nThe paper's running example is public record **BIG001**: **96 samples**, offsets $\\delta_i\\in\\{-30,\\ldots,30\\}$, and the closed TITR band **[70,140] mg\u002FdL**. As recorded, **84\u002F96** readings are in range. Treating every row's offset independently gives the vacuous interval **[33,96]** (width 63). Under a TV budget $V=4$ the exact envelope is **[63,92] out of 96** (65.6%–95.8%), 54.0% narrower. On this record 33 rows are always-hit, and the 63 active rows merge into $r=56$ runs.\n\nThese are **exact extrema, not confidence intervals**. Separate metrics may attain their extrema on different paths. The offset radius and drift budget are user-specified query parameters; the operator does not fit them to sensor data. [Explore the example interactively →](https:\u002F\u002Foliverdou776.github.io\u002FExact-Temporal-Range-Queries-through-Local-State-Windows\u002F#example)\n\n**Results in brief:** across **6,804** query cells per request mode on **211** public CGM series, LocalWindows agrees bit for bit with three exact DP baselines (SparseGlobal, GapComponents, RunTailFullG) and lowers prepared-operator runtime at $V\\in\\{1,4\\}$ (participant-median ratios **0.488–0.889**; $p\\le5.7\\times10^{-37}$ at $V=1$ and $p\\le3.2\\times10^{-36}$ at $V=4$). On the 3,798 non-static cells its median speedups over SparseGlobal are **3.03×** ($V=1$) and **1.72×** ($V=4$); on 1,152-sample horizons the summed-time speedup reaches **10.2×**. At $V\\ge16$, where the windows approach the full offset grid, the global baselines regain the advantage. [Full results below.](#results)\n\n## What this solves\n\nLet $g=(g_1,\\ldots,g_n)$ be an ordered series and $[L,U]$ a threshold band (two-sided or one-sided). Each reading is perturbed by an integer offset $\\delta_i\\in D=\\{-R,\\ldots,R\\}$, $m=|D|=2R+1$, and consecutive offsets share a total-variation budget:\n\n$$\n\\operatorname{TV}(\\delta)=\\sum_{i=2}^{n}|\\delta_i-\\delta_{i-1}|\\le v,\\qquad\nC(\\delta)=\\sum_{i=1}^{n}\\mathbf{1}\\{L\\le g_i+\\delta_i\\le U\\}.\n$$\n\nFor every budget $v$ in an ordered bank $\\mathcal{V}=\\{v_1\u003C\\cdots\u003Cv_K\\}$, LocalWindows returns the exact envelope $[\\operatorname{lo}(v),\\operatorname{hi}(v)]$ of $C(\\delta)$ over all feasible trajectories, together with the range-proportion interval $[100\\,\\operatorname{lo}(v)\u002Fn,\\ 100\\,\\operatorname{hi}(v)\u002Fn]$. At $v=0$ every constant shift is allowed; the envelope widens monotonically with $v$ and saturates at the independent per-sample bounds once $v\\ge2R(n-1)$.\n\nThis repository's implementations solve the same problem in a slightly more general form: any consecutive integer domain $\\{a,\\ldots,b\\}$, the reading-minus-offset convention above, open or closed decimal band endpoints, and nonnegative row weights (weight 0 masks a row without resetting the shared budget). [Formulation and implementation contract](docs\u002Fmethod.md)\n\n## Quick start\n\nPython 3.10+; the Python package uses the standard library.\n\n```bash\npython -m pip install -e .\npython -m lsw_range examples\u002Fsynthetic.json\n```\n\n```python\nfrom lsw_range import solve_intervals\n\n# The four weighted runs in the mechanism figure: (lower, upper, weight).\nanswer = solve_intervals(\n    [(2, 6, 2), (7, 13, 1), (4, 19, 3), (10, 17, 2)],\n    domain=(0, 23),\n    budgets=[4],\n)\nprint(answer.bounds)  # ((0, 8),)\n```\n\nFor measured observations, `solve_glucose` compiles a glucose band to exact hit-offset intervals before solving.\n\nThe native C++17 path accepts unit-count rows. This synthetic example expands the mechanism figure's integer weights into repeated unit rows:\n\n```bash\nmkdir -p build\nc++ -std=c++17 -O3 native\u002Flsw_range.cpp -o build\u002Flsw-native\nbuild\u002Flsw-native \u003C examples\u002Fsynthetic_native.txt\n```\n\nThe JSON CLI demo and native demo return bounds `[[0,6], [0,6], [0,8]]` for budgets `[0,1,4]`. [API & examples](docs\u002Fapi.md) · [Native input protocol](docs\u002Fnative.md) · [Implementation provenance](docs\u002Fprovenance.md)\n\nIn Python, use `method=\"global\"` or `method=\"gap\"` to compare exact global-grid and gap-split plans, and `method=\"reference\"` as a small-case literal-state correctness oracle. The native driver also exposes the paper's three baselines (`GlobalBudgetBank` = SparseGlobal, `GapComponents`, `RunTailFullGThenGather` = RunTailFullG) and the `LocalWindowsGeneric` ablation. The local plan is intended for small and moderate maximum budgets; this release does not provide an automatic plan selector.\n\n## Method\n\nLocalWindows has three stages; lemma and theorem numbers refer to [the paper](docs\u002Fassets\u002Fpaper.pdf).\n\n1. **Extrema-preserving run reduction.** Always-hit ($I_i=D$) and always-miss ($I_i=\\emptyset$) rows contract into scalar constants $c_1,c_0$ (**Lemma 1, fixed-row contraction**), and adjacent identical offset intervals merge into $r$ positive-weight runs (**Theorem 1, duplicate-run merging**). Neither step changes any budget-constrained minimum or maximum. A single $O(r+m)$ difference-array sweep then gives the static depth $d(z)$ and the exact $V=0$ envelope.\n2. **Overlapping $2V$-state window cover.** A trajectory with $\\operatorname{TV}\\le V$ has range diameter at most $V$, so overlapping windows $W_j=B_j\\cup B_{j+1}$ built from adjacent blocks of the offset grid contain every feasible trajectory (**Lemma 2**). Relative to a window, each run is a disjoint miss, a covered hit, or an active boundary run. Each run is active in at most four windows, so there are **at most $4r$ run–window incidences** in total (**Lemma 3**), and covered runs fold into an $O(1)$ static-depth baseline read from $d(z)$.\n3. **Linear-time local sweeps.** Each active window runs a two-pass $O(|W_j|)$ state-line transition kernel up to a local saturation cap shared by the whole budget bank (**Proposition 1**). For unit drift, an **$O(r+m)$ boundary-prefix fast path** evaluates only single steps at run boundaries and needs no DP table (**Proposition 2**).\n\n**Exactness and complexity (Theorem 2).** Run compression and the static $V=0$ evaluation take $O(n+m)$ time. For $V=1$ the boundary-prefix fast path takes $O(r+m)$ time and $O(m)$ space. For $V\\ge2$ the local DP performs at most\n\n$$\n\\sum_{j\\in\\mathcal{A}}|R_j|\\,(B_j+1)\\,|W_j|\\;\\le\\;4r(V+1)(2V+1)\n$$\n\ninner-loop state updates: $O(rV^2+m)$ time and $O(V^2+m)$ working memory when $V\\ll m$, and $O(rVm)$ in the worst case when $V=\\Omega(m)$. Relative to global run-compressed DP, the work ratio is $\\rho(V)\\le4(2V+1)\u002Fm$, so the advantage fades as $2V+1$ approaches $m$; this is the crossover seen at $V\\ge16$ on $m=61$.\n\nThe repository's Python and browser solvers use blocks of $V$ states, so each window has at most $2V$ states, and by default they restrict each window to its critical offsets. [Full formulation, implementation contract and limits](docs\u002Fmethod.md)\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Mechanism figure and two more teaching examples\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"docs\u002Fassets\u002Flocal-state-windows.png\" width=\"100%\" alt=\"Exact mathematical example: four weighted interval runs, overlapping state windows of at most eight states, twelve active run-window incidences, fixed-score recovery, and global count extrema zero and eight.\">\n\u003C\u002Fp>\n\nA mathematical example computed with this repository's solver: $D=\\{0,\\ldots,23\\}$, $V=4$, four weighted runs, windows of at most $2V=8$ states and twelve active run–window incidences ($\\le4r=16$). Restoring the covered-run baseline in window $W_2=[8,15]$ turns its local envelope $[1,3]$ into $[4,6]$; reducing all local and static extrema gives the global envelope $[0,8]$.\n\nBoth teaching examples below use the closed band **[70,140] mg\u002FdL**, corrected value **glucose − offset**, and offsets **0 or 1**.\n\n| Example | Budget | Exact count bounds | Why |\n|:--|:--|:--|:--|\n| One reading: **141** | 0 | **[0,1]** | Offset 0 leaves 141 outside; offset 1 gives 140 inside. |\n| Mask the middle: **70,100,141**, weights **1,0,1** | **0 → 1** | **[1,1] → [0,2]** | The middle row adds no count; the retained rows still share one budget. |\n\nThese and the opening two-reading example are fully specified synthetic teaching cases. The BIG001 demo uses public observations.\n\n\u003C\u002Fdetails>\n\n## Results\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"docs\u002Fassets\u002Fpaper-fig3.png\" width=\"100%\" alt=\"Figure 3 of the paper: participant-median LocalWindows\u002Fbaseline runtime ratios with 95% bootstrap intervals and summed-time ratios against SparseGlobal, GapComponents and RunTailFullG in replications R1 and R2, favoring LocalWindows at budgets 1 and 4 and the baselines at budget 64 and on the bank; absolute prepared-operator latency medians and 95th percentiles.\">\n\u003C\u002Fp>\n\n**211 public CGM series · 6,804 query cells per request mode · two independent replications (R1, R2).** The series come from the PhysioNet BIG IDEAs cohort (16 participants) and the Shanghai diabetes CGM cohort (195 patient series). Each cell is an $n=96$ window evaluated for one of six consensus predicates (TIR, TITR, TBR70, TBR54, TAR180, TAR250) and one offset radius $R\\in\\{15,30,120\\}$ mg\u002FdL ($m\\in\\{31,61,241\\}$), in five request modes: single budgets $V\\in\\{1,4,16,64\\}$ and the ordered bank $\\{0,1,4,16,64\\}$. All four operators agree bit for bit on every count and percentage (**0\u002F68,040** primary cell comparisons mismatched).\n\n| Budget $V$ | LocalWindows \u002F SparseGlobal | LocalWindows \u002F GapComponents | LocalWindows \u002F RunTailFullG | Regime |\n|:--|--:|--:|--:|:--|\n| 1 | 0.838–0.846 (*T* 0.562–0.565) | 0.867–0.882 (*T* 0.679–0.686) | 0.488–0.499 (*T* 0.054–0.062) | Unit drift: faster than all baselines, $p\\le5.7\\times10^{-37}$ |\n| 4 | 0.856–0.861 (*T* 0.456–0.471) | 0.880–0.889 (*T* 0.543–0.557) | 0.614–0.620 (*T* 0.092–0.104) | Moderate drift: faster than all baselines, $p\\le3.2\\times10^{-36}$ |\n| 16 | 1.069–1.086 (*T* 0.830–0.880) | 1.040–1.058 (*T* 0.883–0.981) | 0.890–0.898 (*T* 0.298–0.309) | Transition: medians favor SparseGlobal and GapComponents; *T* and the RunTailFullG comparison favor LocalWindows |\n| 64 | 1.291–1.293 (*T* 2.194–2.256) | 1.276–1.283 (*T* 2.169–2.203) | 1.411–1.416 (*T* 1.387–1.574) | Dense: baselines faster |\n| Bank: 0, 1, 4, 16, 64 | 1.305–1.319 (*T* 2.095–2.185) | 1.269–1.275 (*T* 2.102–2.118) | 1.381–1.424 (*T* 1.298–1.604) | Dense: baselines faster |\n\nEntries are the **participant-level median geometric-mean runtime ratio** (LocalWindows\u002Fbaseline), shown as the range over replications R1 and R2, followed by the summed-time ratio $T=\\sum_c t_\\text{local}(c)\u002F\\sum_c t_\\text{base}(c)$. Below one favors LocalWindows. The paper's Table II gives each replication with its 95% participant-bootstrap interval (2,000 resamples); [all values are transcribed here](docs\u002Fbenchmarks.md#primary-prepared-operator-runtime-table-ii). At $V=1$, LocalWindows totals **69.33 \u002F 70.56 ms** over the 6,804 cells in R1 \u002F R2.\n\n**Why it is faster.** On the 3,798 non-static cells ($r\\ge1$; median $r=24$ runs from $n=96$), the $V=1$ fast path performs no DP state updates and reaches a median runtime ratio of **0.330 (3.03×)** against SparseGlobal and 0.336 (2.98×) against GapComponents, with a 100% participant win rate. At $V=4$ a median of 4 active windows cuts inner-loop DP updates to $\\rho(4)=0.340$, for a median ratio of **0.583 (1.72×)** and 0.601 (1.66×). The incidences per run never exceed the ceiling of 4 in any cell (0\u002F3,798 violations). Widening the offset grid helps: at $V=4$ the median speedup over SparseGlobal grows from 1.07× ($R=15$) to 1.72× ($R=30$) and 2.26× ($R=120$).\n\n**Longer horizons.** Summed-time ratio LocalWindows\u002FSparseGlobal (R1 \u002F R2), Table IV of the paper:\n\n| Budget | $n=96$ (1 day) | $n=288$ (3 days) | $n=576$ (6 days) | $n=1{,}152$ (12 days) |\n|:--|--:|--:|--:|--:|\n| $V=1$ | 0.310 \u002F 0.317 | 0.172 \u002F 0.175 | 0.130 \u002F 0.131 | 0.101 \u002F 0.096 |\n| $V=4$ | 0.332 \u002F 0.340 | 0.203 \u002F 0.224 | 0.181 \u002F 0.180 | 0.163 \u002F 0.177 |\n| $V=16$ | 0.827 \u002F 0.804 | 0.626 \u002F 0.622 | 0.586 \u002F 0.583 | 0.546 \u002F 0.574 |\n\nAt $V=1$ the summed-time speedup grows from 3.19× to **10.15×**; at $V=16$ the share of cells where LocalWindows is slower than SparseGlobal falls from 35.4% to 10.0%. Without the boundary-prefix fast path, window localization alone gives 2.72×–8.26× over SparseGlobal; the fast path adds a further 18%–23%.\n\n**Scope.** These are the paper's prepared-operator timings of C++20 implementations (g++ -O3) that share parsing, interval compilation and 64-bit integer arithmetic. In a cold, uncached source-to-report pipeline, file I\u002FO and parsing (30–75 ms per 18-cell report) dominate the prepared operator (0.05–2.5 ms), and most 95% intervals on end-to-end report time span 1.0. The numbers above are not timings of this repository's Python package, native driver or browser tool. [All tables, estimators and protocol →](docs\u002Fbenchmarks.md)\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>BIG001 figure and data attribution\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"docs\u002Fassets\u002Fbig001-exact-counts.png\" width=\"100%\" alt=\"BIG001 observations and exact count envelopes under offsets from minus thirty to thirty, computed by the repository solver; TITR envelopes widen as the shared variation budget increases while TIR stays fixed.\">\n\u003C\u002Fp>\n\nFor public record **BIG001**, $n=96$, $D=\\{-30,\\ldots,30\\}$, and the closed TITR band is $[70,140]$ mg\u002FdL. The envelopes in this figure were computed with this repository's solver (in its reading-minus-offset form, which gives the same envelopes on this symmetric domain); the browser tool and the Python reference oracle return the same values. At budget $V=4$ the exact envelope is **[63,92] out of 96**. At budget zero, every constant offset in the domain is allowed.\n\nThe plotted data are from BIG IDEAs Lab Glycemic Variability and Wearable Device Data, version **1.1.3**; [attribution and figure details](docs\u002Ffigures.md) accompany the artwork. The optional [BIG001 verifier](examples\u002Fverify_big001.py) takes a user-supplied official CSV; see the [verification command](docs\u002Fapi.md#optional-fixed-big001-example).\n\n\u003C\u002Fdetails>\n\n## Citation\n\n```bibtex\n@misc{wang2026rangecount,\n  title  = {Exact Range-Count Envelopes Over Ordered Time Series Under Total-Variation Drift Budgets},\n  author = {Wang, Zijia and Toumazou, Christofer},\n  year   = {2026},\n  url    = {https:\u002F\u002Fgithub.com\u002FOliverDOU776\u002FExact-Temporal-Range-Queries-through-Local-State-Windows}\n}\n```\n\nThe paper is included as [docs\u002Fassets\u002Fpaper.pdf](docs\u002Fassets\u002Fpaper.pdf). [CITATION.cff](CITATION.cff) carries the same reference.\n\n## Attribution\n\nSoftware and manuscript: Zijia Wang and Christofer Toumazou, Centre for Bio-Inspired Technology, Department of Electrical and Electronic Engineering, Imperial College London. The [project page](https:\u002F\u002Foliverdou776.github.io\u002FExact-Temporal-Range-Queries-through-Local-State-Windows\u002F) starts with worked examples and includes the browser query tool, the BIG001 example, the paper's results and runnable code.\n\nThe paper's evaluation uses [BIG IDEAs Lab data v1.1.3](https:\u002F\u002Fdoi.org\u002F10.13026\u002Faw6y-fc44) and [Shanghai diabetes datasets v5](https:\u002F\u002Fdoi.org\u002F10.6084\u002Fm9.figshare.21600933.v5). The clinical thresholds follow the international consensus on time in range (Battelino et al., *Diabetes Care* 42(8), 2019). Retain the third-party attribution and applicable licenses when reusing data or derived figures. See [figure provenance](docs\u002Ffigures.md) and the [third-party notices](NOTICE).\n","该项目实现了一种针对有序时间序列的精确时序范围计数包络计算方法，用于在总变差（Total Variation）漂移预算约束下，求解传感器读数经平滑偏移后在指定阈值区间内的最小与最大可能计数值。核心功能包括：支持整数偏移路径建模、批量处理多档TV预算、提供Python实现及C++高性能基线、内置浏览器交互式查询工具；技术特点为严格数学保证下的精确解（非近似），适用于存在校准漂移的生理信号分析场景，尤其面向连续血糖监测（CGM）中的‘时间在范围内’（TIR\u002FTITR）等临床指标鲁棒性评估。",2,"2026-11-24 04:53:23","CREATED_QUERY"]