pub struct LinearRegression {
pub params: LrParams,
}Fields§
§params: LrParamsImplementations§
Trait Implementations§
Source§impl Clone for LinearRegression
impl Clone for LinearRegression
Source§fn clone(&self) -> LinearRegression
fn clone(&self) -> LinearRegression
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LinearRegression
impl Debug for LinearRegression
Source§impl Indicator for LinearRegression
impl Indicator for LinearRegression
Source§fn calculate(
&self,
candles: &[Candle],
) -> Result<IndicatorOutput, IndicatorError>
fn calculate( &self, candles: &[Candle], ) -> Result<IndicatorOutput, IndicatorError>
Ports rolling(window=period).apply(lambda y: np.polyfit(X, y, 1)[0]).
OLS slope = Σ(xᵢ − x̄)(yᵢ − ȳ) / Σ(xᵢ − x̄)² where xᵢ = i.
This is algebraically identical to np.polyfit’s degree-1 coefficient.
Source§fn required_len(&self) -> usize
fn required_len(&self) -> usize
Minimum number of candles required before output is non-
NaN.
Mirrors Python’s implicit warm-up period used for validation.Source§fn required_columns(&self) -> &[&'static str]
fn required_columns(&self) -> &[&'static str]
Which OHLCV fields this indicator reads. Read more
Auto Trait Implementations§
impl Freeze for LinearRegression
impl RefUnwindSafe for LinearRegression
impl Send for LinearRegression
impl Sync for LinearRegression
impl Unpin for LinearRegression
impl UnsafeUnpin for LinearRegression
impl UnwindSafe for LinearRegression
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more