gluonts.mx.model.forecast module

class gluonts.mx.model.forecast.DistributionForecast(distribution: gluonts.mx.distribution.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 GluonTS 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 – 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.

Parameters

q – Quantile to compute.

Returns

Value of the quantile across the prediction range.

Return type

numpy.ndarray

start_date = None
to_quantile_forecast(quantiles: List[Union[str, float]])[source]
to_sample_forecast(num_samples: int = 200) → gluonts.model.forecast.SampleForecast[source]