Skip to content

Feature request: allow predict_likelihood_parameters for auto-regressive QuantileRegression #2912

@daidahao

Description

@daidahao

Is your feature request related to a current problem? Please describe.
Currently, sampling from torch-based, auto-regressive QuantileRegression models is slow and consumes a great amount of memory.
Allowing predict_likelihood_parameters for auto-regressive QuantileRegression could skip Monte Carlo sampling entirely and speed up forecasting.

The issues has been explored previously in #2731, but I would like to re-open the issue here. I think a slight alternation to the solution might lead to better results.

Describe proposed solution

  1. model.predict() allows predict_likelihood_parameters=True and n>output_chunk_length only when num_samples=1 and model.likelihood is QuantileRegression (for now, other likelihoods could be explored in the future).
  2. Inside PLForecastingModule.predict_step() when making auto-regressive, batch prediction, appends the median ($q=0.5$) prediction to the target.

This is also a common sampling approach with some of the latest deep learning models, such as Chronos-Bolt, TimesFM, etc.

Describe potential alternatives
We could also set num_samples=len(quantiles) for model.predict(). When appending the prediction, we first get new quantiles from such those samples and use those new quintiles as the new samples for target. However, this may add great complexity to the implementation since the samples might be spread across different batches.

Additional context
I tried replicating the experiment in #2731 (the best I could) and am getting better convergence than before. However, my model might not have the same hyper-parameters as @dennisbader, so please take that with a grain of salt.

  • input_chunk_length=24
  • output_chunk_length=12
  • quantiles=[0.1, 0.5, 0.9]
  • "forecast sampled" is plotted with [0.1, 0.9] quantiles.

On the other hand and fundamentally, this is a different sampling method than Monte Carlo. Divergence should be small but is expected over longer auto-regressive horizons.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestUse this label to request a new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions