pastas.forecast.forecast#
- pastas.forecast.forecast(ml: pastas.typing.Model, forecasts: dict[str, list[pandas.DataFrame]], p: pastas.typing.ArrayLike | None = None, post_process: bool = False) pandas.DataFrame#
Method to forecast the head from ensembles of stress forecasts.
- Parameters:
ml (pastas.Model) – Pastas Model instance.
forecasts (dict) – Dictionary containing the forecasts data. The keys are the stressmodel names and the values are lists of DataFrames containing the forecasts with a datetime index and each column a time series (i.e., one ensemble member).
p (array_like, optional) – List of parameter sets to use for the forecasts. If None, a single parameter set is used that defaults to the optimal model parameters. Default is None.
post_process (bool, optional) – If True, the forecasts are post-processed using the noise model of the model instance. Default is False. If True, a noise model should be present in the model instance. If no noisemodel is present and post_process is True, an error is raised.
- Returns:
df – DataFrame containing the forecasts. The columns are a MultiIndex with the first level the ensemble member, the second level the parameter member, and the third level the mean and the variance of each forecast member.
- Return type:
Notes
For efficiency, the iteration over the different ensemble members and parameters sets is done in the following order using a double for-loop:
iterate over the ensemble members
iterate over the parameter sets
All computations that only depend on the parameter sets and not on the ensemble members are performed outside this double for-loop.
Please note that only the AR1 noise model is supported at this moment for post-processing.