Navigation apps estimate speed from the phones of a few drivers: see how many users they need, and what bias does
Navigation apps collect GPS “pings” from phones at regular intervals. A car that spends twice as long on a stretch sends twice as many pings, so averaging the pings gives a space-mean speed, just like the drone. The catch: only cars running the app are counted.
NoteBefore you play: predict
Only 5 % of cars run the app. Is its speed noisy, biased, or both? Which of the two would more app users cure?
viewof pen =knob({min:1,max:50,step:1,value:5,label:"Cars running the app",format: p =>`${p} %`})viewof appBias =knob({min:0,max:20,step:1,value:0,label:"App users drive faster by",format: p =>`${p} %`})viewof probeRun =action("↻ Run 300 more days")
md`Each dot is one five-minute period. Typical error: **±${probe.rmse.toFixed(1)} km/h** · average error (bias): **${probe.bias>=0?"+":""}${probe.bias.toFixed(1)} km/h**${probe.none?` · in ${probe.none} of 300 periods, not a single app user passed`:""}.`
What it shows
Two lessons: too few app users gives noise, and app users who drive differently give bias. More data cures noise, never bias. Lecture 2 places this among every other traffic sensor.
import {knob, action, panel, row} from"../assets/controls.js"theme = Generators.observe(notify => {const read = () =>notify(document.body.classList.contains("quarto-dark") ?"dark":"light");read();const watcher =newMutationObserver(read); watcher.observe(document.body, {attributes:true,attributeFilter: ["class"]});return () => watcher.disconnect();})accent = theme ==="dark"?"#c9a0ff":"#57068c"accentRange = theme ==="dark"? ["#4b3a5c","#ecdcff"] : ["#dccbee","#3a0463"]ink = theme ==="dark"?"#f2f2f2":"black"// Plot width: Plot's default 640 px, except on a phone, where a plot is drawn to fit its card// instead of being shrunk (and its text with it). Changes only when the width actually changes.plotW = Generators.observe(notify => {let last;const read = () => {const main =document.querySelector("main"), fit = main ? main.clientWidth-50:640;const w =!document.querySelector(".reveal") && fit <640?Math.max(240,Math.floor(fit)) :640;if (w !== last) notify(last = w); };read();window.addEventListener("resize", read);return () =>window.removeEventListener("resize", read);})