gluonts.mx.model.tpp.forecast module#

class gluonts.mx.model.tpp.forecast.PointProcessSampleForecast(samples: Union[mxnet.ndarray.ndarray.NDArray, numpy.ndarray], valid_length: Union[mxnet.ndarray.ndarray.NDArray, numpy.ndarray], start_date: pandas._libs.tslibs.timestamps.Timestamp, freq: str, prediction_interval_length: float, item_id: Optional[str] = None, info: Optional[Dict] = None)[source]#

Bases: gluonts.model.forecast.Forecast

Sample forecast object used for temporal point process inference. Differs from standard forecast objects as it does not implement fixed length samples. Each sample has a variable length, that is kept in a separate valid_length attribute.

Importantly, PointProcessSampleForecast does not implement some methods (such as quantile or plot) that are available in discrete time forecasts.

Parameters
  • samples – A multidimensional array of samples, of shape (number_of_samples, max_pred_length, target_dim). The target_dim is equal to 2, where the first dimension contains the inter-arrival times and the second - categorical marks.

  • valid_length – An array of integers denoting the valid lengths of each sample in samples. That is, valid_length[0] == 2 implies that only the first two entries of samples[0, ...] are valid “points”.

  • start_date (pandas._libs.tslibs.period.Period) – Starting Timestamp of the sample

  • freq – The time unit of interarrival times

  • prediction_interval_length (float) – The length of the prediction interval for which samples were drawn.

  • item_id (Optional[str]) – Item ID, if available.

  • info (Optional[Dict]) – Optional dictionary of additional information.

dim() int[source]#

Return the dimensionality of the forecast object.

property freq#
property index: pandas.core.indexes.period.PeriodIndex#
info: Optional[Dict]#
item_id: Optional[str]#
mean = None#
plot(**kwargs)[source]#

Plot median forecast and prediction intervals using matplotlib.

By default the 0.5 and 0.9 prediction intervals are plotted. Other intervals can be choosen by setting intervals.

This plots to the current axes object (via plt.gca()), or to ax if provided. Similarly, the color is using matplotlibs internal color cycle, if no explicit color is set.

One can set name to use it as the label for the median forecast. Intervals are not labeled, unless show_label is set to True.

prediction_interval_length: float#
prediction_length: int = None#
quantile(q: Union[float, str]) numpy.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

start_date: pandas._libs.tslibs.period.Period#