Trait augurs_mstl::TrendModel

source ·
pub trait TrendModel: Debug {
    // Required methods
    fn name(&self) -> Cow<'_, str>;
    fn fit(
        &self,
        y: &[f64],
    ) -> Result<Box<dyn FittedTrendModel + Sync + Send>, Box<dyn Error + Send + Sync + 'static>>;
}
Expand description

A trend model.

Trend models are used to model the trend component of a time series. Examples implemented in other languages include ARIMA, Theta and ETS.

You can implement this trait for your own trend models.

Required Methods§

source

fn name(&self) -> Cow<'_, str>

Return the name of the trend model.

source

fn fit( &self, y: &[f64], ) -> Result<Box<dyn FittedTrendModel + Sync + Send>, Box<dyn Error + Send + Sync + 'static>>

Fit the model to the given time series.

This method is called once before any calls to predict or predict_in_sample.

Implementations should store any state required for prediction in the struct itself.

Implementations on Foreign Types§

source§

impl<T: TrendModel + ?Sized> TrendModel for Box<T>

source§

fn name(&self) -> Cow<'_, str>

source§

fn fit( &self, y: &[f64], ) -> Result<Box<dyn FittedTrendModel + Sync + Send>, Box<dyn Error + Send + Sync + 'static>>

Implementors§