LoadModule.set_forecaster#

LoadModule.set_forecaster(forecaster, forecast_horizon=23, forecaster_increase_uncertainty=False, forecaster_relative_noise=False)[source]#

Set the forecaster for this module.

Sets the forecaster with the same logic as upon initialization.

forecastercallable, float, “oracle”, or None, default None.

Function that gives a forecast n-steps ahead.

  • If callable, must take as arguments (val_c: float, val_{c+n}: float, n: int), where

    • val_c is the current value in the time series: self.time_series[self.current_step]

    • val_{c+n} is the value in the time series n steps in the future

    • n is the number of steps in the future at which we are forecasting.

    The output forecast = forecaster(val_c, val_{c+n}, n) must have the same sign as the inputs val_c and val_{c+n}.

  • If float, serves as a standard deviation for a mean-zero gaussian noise function that is added to the true value.

  • If "oracle", gives a perfect forecast.

  • If None, no forecast.

forecast_horizonint

Number of steps in the future to forecast. If forecaster is None, this parameter is ignored and the resultant horizon will be zero.

forecaster_increase_uncertaintybool, default False

Whether to increase uncertainty for farther-out dates if using a GaussianNoiseForecaster. Ignored otherwise.

forecaster_relative_noisebool, default False

Whether to define noise standard deviation relative to mean of time series if using GaussianNoiseForecaster. Ignored otherwise.