gluonts.torch.model.forecast module

class gluonts.torch.model.forecast.DistributionForecast(distribution: torch.distributions.distribution.Distribution, start_date: pandas._libs.tslibs.timestamps.Timestamp, freq: str, item_id: Optional[str] = None, info: Optional[Dict] = None)[source]

Bases: gluonts.model.forecast.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).

  • 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 – start of the forecast

  • freq – forecast frequency

  • info – additional information that the forecaster may provide e.g. estimated parameters, number of iterations ran etc.

freq = None
info = None
item_id = None
property mean

Forecast mean.

property mean_ts

Forecast mean, as a pandas.Series object.

prediction_length = None
quantile(level: Union[float, str]) → numpy.ndarray[source]

Computes a quantile from the predicted distribution.


q – Quantile to compute.


Value of the quantile across the prediction range.

Return type


start_date = None
to_sample_forecast(num_samples: int = 200) → gluonts.model.forecast.SampleForecast[source]