Package com.framed.cdss.utils
Class SlopeUtils
java.lang.Object
com.framed.cdss.utils.SlopeUtils
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doubleComputes the least-squares linear regression slope of the ETCO2 signal over the provided sliding window, using time in seconds relative to the first sample in the window.
-
Constructor Details
-
SlopeUtils
public SlopeUtils()
-
-
Method Details
-
computeSlope
Computes the least-squares linear regression slope of the ETCO2 signal over the provided sliding window, using time in seconds relative to the first sample in the window.The slope is returned in units of mmHg/sec (assuming input values are mmHg).
Numerical stability: If the time axis degenerates (e.g., repeated identical timestamps), the denominator may be zero; in that case, the method returns
0.0.- Parameters:
win- Deque of recent samples (time/value) representing the current slope window.- Returns:
- The regression slope in mmHg/sec; returns
0.0if insufficient variance in time.
-