Background
The second-order smoothness metric (I₂) in Pullman 1998 is computed from residuals off a quadratic fit to the radius-angle transform — r = aθ² + bθ + c. Currently the tremor plot shows the raw radius-angle signal but does not visualize this underlying quadratic curve, making it impossible for a clinician to see the geometric shape driving the I₂ value.
Tasks
Acceptance criteria / tests
-
Regression correctness — feed a synthetic perfect Archimedean spiral (r = aθ) and verify the quadratic term is near zero; feed a known quadratic signal and verify recovered coefficients match
-
I₂ consistency — recompute I₂ using residuals from the visualization curve and assert it matches the existing reported value for real patient spirals
-
Rendering — snapshot test the plot component with a synthetic dataset; curve appears, spans full θ range, and has not shifted between builds
-
Edge case — short spirals with very few points degrade gracefully; no crash or wild extrapolation
Background
The second-order smoothness metric (I₂) in Pullman 1998 is computed from residuals off a quadratic fit to the radius-angle transform — r = aθ² + bθ + c. Currently the tremor plot shows the raw radius-angle signal but does not visualize this underlying quadratic curve, making it impossible for a clinician to see the geometric shape driving the I₂ value.
Tasks
Locate where I₂ is computed in the codebase and extract the quadratic coefficients (a, b, c) from that existing fit rather than running a second independent regression
Overlay the fitted curve as a smooth line on the radius-angle transform plot, visually distinct from the raw signal (different color and weight)
Curve must span the full θ range of the data
Optionally display the coefficients or label the curve in the plot
Acceptance criteria / tests
Regression correctness — feed a synthetic perfect Archimedean spiral (r = aθ) and verify the quadratic term is near zero; feed a known quadratic signal and verify recovered coefficients match
I₂ consistency — recompute I₂ using residuals from the visualization curve and assert it matches the existing reported value for real patient spirals
Rendering — snapshot test the plot component with a synthetic dataset; curve appears, spans full θ range, and has not shifted between builds
Edge case — short spirals with very few points degrade gracefully; no crash or wild extrapolation