solarforecastarbiter.reference_forecasts.persistence.persistence_scalar¶
-
solarforecastarbiter.reference_forecasts.persistence.
persistence_scalar
(observation, data_start, data_end, forecast_start, forecast_end, interval_length, interval_label, load_data)[source]¶ Make a persistence forecast using the mean value of the observation from data_start to data_end.
In the example below, we use GHI to be concrete but the concept applies to any kind of observation data. The persistence forecast is:
\[GHI_{t_f} = \overline{GHI_{t_{start}} \ldots GHI_{t_{end}}}\]where \(t_f\) is a forecast time, and the overline represents the average of all observations that occur between \(t_{start}\) = data_start and \(t_{end}\) = data_end.
Parameters: - observation (datamodel.Observation) –
- data_start (pd.Timestamp) – Observation data start. Forecast is inclusive of this instant if observation.interval_label is beginning or instant.
- data_end (pd.Timestamp) – Observation data end. Forecast is inclusive of this instant if observation.interval_label is ending or instant.
- forecast_start (pd.Timestamp) – Forecast start. Forecast is inclusive of this instant if interval_label is beginning or instant.
- forecast_end (pd.Timestamp) – Forecast end. Forecast is inclusive of this instant if interval_label is ending or instant.
- interval_length (pd.Timedelta) – Forecast interval length
- interval_label (str) – instant, beginning, or ending
- load_data (function) – A function that loads the observation data. Must have the signature load_data(observation, data_start, data_end) and properly account for observation interval label.
Returns: forecast (pd.Series) – The persistence forecast.