gluonts.torch.model.forecast module#
- class gluonts.torch.model.forecast.DistributionForecast(distribution: Distribution, start_date: Period, item_id: Optional[str] = None, info: Optional[Dict] = None)[source]#
Bases:
Forecast
A Forecast object that uses a distribution directly.
This can for instance be used to represent marginal probability distributions for each time point – although joint distributions are also possible, e.g. when using MultiVariateGaussian).
- Parameters:
distribution –
Distribution object. This should represent the entire prediction length, i.e., if we draw num_samples samples from the distribution, the sample shape should be
samples = trans_dist.sample(num_samples) samples.shape -> (num_samples, prediction_length)
start_date (pandas._libs.tslibs.period.Period) – start of the forecast
info (Optional[Dict]) – additional information that the forecaster may provide e.g. estimated parameters, number of iterations ran etc.
- property mean: ndarray#
Forecast mean.
- property mean_ts: Series#
Forecast mean, as a pandas.Series object.
- quantile(level: Union[float, str]) ndarray [source]#
Compute a quantile from the predicted distribution.
- Parameters:
q – Quantile to compute.
- Returns:
Value of the quantile across the prediction range.
- Return type:
numpy.ndarray
- to_sample_forecast(num_samples: int = 200) SampleForecast [source]#