unit8co / darts

A python library for user-friendly forecasting and anomaly detection on time series.
https://unit8co.github.io/darts/
Apache License 2.0
8.04k stars 875 forks source link

Question: How to deal with day-ahead forecasts? #789

Closed tharwan closed 2 years ago

tharwan commented 2 years ago

Hi,

first of all: thanks for this very nice package! I hope I will manage to contribute more than a question in the future.

We are working in the energy industry and very often need day-ahead forecasts that predict a whole day. Sometimes the next day and sometimes the day after.

Typically we also have some future covariants that cover this range (e.g. weather forecasts).

BlockRNN seems a good fit to forecast whole days, however does not take future covariants. There are two solutions that seem possible to me:

  1. shift the forecasts with Timeseries.shift(-24) and use them as past covariants
  2. pivot the input data so that each hour becomes its own time series (e.g. all data points of hour 1 for every day are their own time series) and use the RNNModel and then transform the output back

Is there anything in the way the models are build internally that makes either 1 or 2 more promising?

dumjax commented 2 years ago

Hi Florian,

If your goal is to predict a whole day ahead into 24 hour chunks with the same past information (probably the 24 previous hours) and future covariates (weather forecast for each hour), you probably have to consider a daily frequency for your time series.

You obtain then in theory a multivariate time series of dimension 24 to fit. You can either use a model in a multivariate mode, or consider each hours time series separately and do a multi time series training (list of training set, valid set) by taking or not some of the other hours TS as covariates.

Concerning the weather forecast, you can also use them as past covariates if the model is not accepting future covariates. Nevertheless, if your input chunk is larger than 1, you also use the past weather forecast in your training (which could be useless), except if you use a regression model where you can choose which lag you consider for each covariate.

Is the dataset public? are you talking about electricity day-ahead trading?

Hope it helps

tharwan commented 2 years ago

You obtain then in theory a multivariate time series of dimension 24 to fit. You can either use a model in a multivariate mode, or consider each hours time series separately and do a multi time series training (list of training set, valid set) by taking or not some of the other hours TS as covariates.

This is basically what I meant with pivoting the data in 2.

Concerning the weather forecast, you can also use them as past covariates if the model is not accepting future covariates. Nevertheless, if your input chunk is larger than 1, you also use the past weather forecast in your training (which could be useless),

I am not sure I can follow. The input chunk is only a problem if I do the multivariate approach right?

Is the dataset public? are you talking about electricity day-ahead trading?

Unfortunately we can not share the data set. Yes we are talking about day-ahead trading in general but also covering the flexibility/reserve markets as well as not just forecasting prices. So the pattern is forecasting whole days one or two days.

In any case we will try to experiment with both approaches.