Trait 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§