solarforecastarbiter.reference_forecasts.persistence.persistence_scalar_index

solarforecastarbiter.reference_forecasts.persistence.persistence_scalar_index(observation, data_start, data_end, forecast_start, forecast_end, interval_length, interval_label, load_data)[source]

Calculate a persistence forecast using the mean value of the observation clear sky index or AC power index from data_start to data_end.

In the example below, we use GHI to be concrete but the concept also applies to AC power. The persistence forecast is:

\[GHI_{t_f} = \overline{ \frac{ GHI_{t_{start}} }{ GHI_{{clear}_{t_{start}}} } \ldots \frac{ GHI_{t_{end}} }{ GHI_{{clear}_{t_{end}}} } }\]

where \(t_f\) is a forecast time, and the overline represents the average of all observations or clear sky values 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 instantaneous.

data_end : pd.Timestamp

Observation data end. Forecast is inclusive of this instant if observation.interval_label is ending or instantaneous.

forecast_start : pd.Timestamp

Forecast start. Forecast is inclusive of this instant if interval_label is beginning or instantaneous.

forecast_end : pd.Timestamp

Forecast end. Forecast is inclusive of this instant if interval_label is ending or instantaneous.

interval_length : pd.Timedelta

Forecast interval length

interval_label : str

instantaneous, 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. The forecast interval label is the same as the observation interval label.