/** * `variance` and `stdev`. * * **Population by default, the `len` divisor.** `stdlib.md` section 6 fixes it * and gives the reason: that is what the band studies a chart has to reproduce * use. `sample = true` switches to the `len - 1` divisor, so neither camp has * to write the correction by hand and neither has to guess which one a chart * drew. * * Two passes: the mean of the lookback first, then the deviations from it. The * one pass arrangement that subtracts the square of the mean from the mean of * the squares loses most of its significant digits on a price series, where the * values are large and their spread is small, and can even produce a negative * variance that then has to be floored at zero. A study whose implementation * needs a floor to stay real is a study computing the wrong quantity. */ import type { Series, StateRecord, Tail, Value } from '../values/index.js'; /** `variance(src, len, sample)`: the squared deviation over the lookback, from bar `len - 1`. */ export declare function varianceStep(state: StateRecord, key: string, value: Value, len: number | null, sample: boolean): Value; /** `variance(src, len, sample)` as a tail. */ export declare function varianceTail(len: number, sample?: boolean): Tail; /** `variance(src, len, sample)` over a whole series. */ export declare function variance(src: Series, len: number, sample?: boolean): Value[]; /** `stdev(src, len, sample)`: the square root of the same, from bar `len - 1`. */ export declare function stdevStep(state: StateRecord, key: string, value: Value, len: number | null, sample: boolean): Value; /** `stdev(src, len, sample)` as a tail. */ export declare function stdevTail(len: number, sample?: boolean): Tail; /** `stdev(src, len, sample)` over a whole series. */ export declare function stdev(src: Series, len: number, sample?: boolean): Value[]; /** * The mean absolute deviation from the lookback's mean. * * Not a call of its own in `stdlib.md`, and here because `cci` is defined * against it rather than against `stdev`: the 0.015 constant in that study is * calibrated for this quantity, and substituting a standard deviation changes * every reading. */ export declare function meanDeviationStep(state: StateRecord, key: string, value: Value, len: number | null): Value; /** The mean absolute deviation as a tail. */ export declare function meanDeviationTail(len: number): Tail; /** The mean absolute deviation over a whole series. */ export declare function meanDeviation(src: Series, len: number): Value[]; //# sourceMappingURL=deviation.d.ts.map