Trait FittedTrendModel

Source
pub trait FittedTrendModel: Debug {
    // Required methods
    fn predict_inplace(
        &self,
        horizon: usize,
        level: Option<f64>,
        forecast: &mut Forecast,
    ) -> Result<(), Box<dyn Error + Send + Sync + 'static>>;
    fn predict_in_sample_inplace(
        &self,
        level: Option<f64>,
        forecast: &mut Forecast,
    ) -> Result<(), Box<dyn Error + Send + Sync + 'static>>;
    fn training_data_size(&self) -> Option<usize>;

    // Provided methods
    fn predict(
        &self,
        horizon: usize,
        level: Option<f64>,
    ) -> Result<Forecast, Box<dyn Error + Send + Sync + 'static>> { ... }
    fn predict_in_sample(
        &self,
        level: Option<f64>,
    ) -> Result<Forecast, Box<dyn Error + Send + Sync + 'static>> { ... }
}
Expand description

A fitted trend model.

Required Methods§

Source

fn predict_inplace( &self, horizon: usize, level: Option<f64>, forecast: &mut Forecast, ) -> Result<(), Box<dyn Error + Send + Sync + 'static>>

Produce a forecast for the next horizon time points.

The level parameter specifies the confidence level for the prediction intervals. Where possible, implementations should provide prediction intervals alongside the point forecasts if level is not None.

Source

fn predict_in_sample_inplace( &self, level: Option<f64>, forecast: &mut Forecast, ) -> Result<(), Box<dyn Error + Send + Sync + 'static>>

Produce in-sample predictions.

In-sample predictions are used to assess the fit of the model to the training data.

The level parameter specifies the confidence level for the prediction intervals. Where possible, implementations should provide prediction intervals alongside the point forecasts if level is not None.

Source

fn training_data_size(&self) -> Option<usize>

Return the number of training data points used to fit the model.

Provided Methods§

Source

fn predict( &self, horizon: usize, level: Option<f64>, ) -> Result<Forecast, Box<dyn Error + Send + Sync + 'static>>

Return the n-ahead predictions for the given horizon.

The predictions are point forecasts and optionally include prediction intervals at the specified level.

level should be a float between 0 and 1 representing the confidence level of the prediction intervals. If None then no prediction intervals are returned.

§Errors

Any errors returned by the trend model are propagated.

Source

fn predict_in_sample( &self, level: Option<f64>, ) -> Result<Forecast, Box<dyn Error + Send + Sync + 'static>>

Return the in-sample predictions.

The predictions are point forecasts and optionally include prediction intervals at the specified level.

level should be a float between 0 and 1 representing the confidence level of the prediction intervals. If None then no prediction intervals are returned.

§Errors

Any errors returned by the trend model are propagated.

Implementations on Foreign Types§

Source§

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

Source§

fn predict_inplace( &self, horizon: usize, level: Option<f64>, forecast: &mut Forecast, ) -> Result<(), Box<dyn Error + Send + Sync + 'static>>

Source§

fn predict_in_sample_inplace( &self, level: Option<f64>, forecast: &mut Forecast, ) -> Result<(), Box<dyn Error + Send + Sync + 'static>>

Source§

fn training_data_size(&self) -> Option<usize>

Implementors§