Population vs. Sample Standard Deviation in a Finite Rolling Window
Context
You are implementing a rolling standard deviation over a fixed-size window of length k for a time series. Clarify how to compute standard deviation within each window, which denominator to use and why, how that choice impacts rolling estimates (especially for small k), what to return when k = 1, and how to expose and document this choice in code and tests.
Tasks
-
Differentiate population vs. sample standard deviation for a finite window and explain why the denominators are n and n−1 (Bessel’s correction).
-
Explain how this choice affects rolling estimates, especially for small k.
-
Specify what the function should return for k = 1.
-
State which definition you would implement by default, how to make it configurable, and how to document the choice in code and tests.