MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ confidence()

double MayaFlux::Kinesis::Stochastic::Estimate::confidence ( double  step) const

Confidence that a step is signal, not floor.

Parameters
stepDifference in the same units as floor(): a per-sample change, e.g. raw_sample - value(), or any other quantity measured in the same units the stream itself is in.
Returns
0.0 (indistinguishable from floor) to 1.0 (well above floor)

step and floor() must be the same physical quantity. floor() is a static spread (units of the stream itself, e.g. position), not a rate. Passing a Kinesis::Differential velocity or acceleration here compares a rate against a static spread, which are different units and produces a meaningless, typically saturated result: a velocity is often numerically enormous relative to a small per-sample floor regardless of whether the motion is real signal or noise, since dividing by dt inflates the value independent of confidence. For a Differential-derived rate, use confidence_of_rate() instead, which performs the correct rate-to-step conversion before comparing.

Not a hard threshold. A caller wanting a binary decision picks their own cutoff against this; Estimate only reports where the step sits relative to the learned floor.

Definition at line 55 of file Estimate.cpp.

56{
57 const double f = m_state.floor;
58 if (f < 1e-12)
59 return (std::abs(step) > 0.0) ? 1.0 : 0.0;
60
61 const double ratio = std::abs(step) / f;
62 return std::clamp(ratio / 3.0, 0.0, 1.0);
63}

References MayaFlux::Kinesis::Stochastic::EstimateState::floor, and m_state.