This message was deleted.
# neural-forecast
s
This message was deleted.
o
Hi, hope I can help. Do you know what drives the outliers?
r
Lack of wind or sun to generate renewable energy, but also probably driven by market mechanisms that blow up the price. We have this data, but so far not really clear seen indication that warn us for these price spikes. However, it may be that with deep multivariate time series models some underlying patterns can be detected.
I don’t necessarily expect the model to forecast the values of these spikes, but we hope to know if we can detect whether an anomaly/demand peak will occur or not. My question is what the best way would be to try to learn this. A simply multivariate model, fine tuning PatchTST, another architecture, a model with exogenious variables, an anomaly forecasting model (how would this work), demand peaks, or something totally different. I’m a bit lost, haha
o
I'd start then with a simple classifier that predicts 1/0 for occurance of a spike/outlier, based on (i) past data of the series, (ii) relevant other exogenous features (start small). If your graph is representative, there are very few spikes, correct?
r
Yes, there are few spikes. But what type of classifier architecture would you recommend? Is there a way to make use of deep learning time series models for classification?
o
Yes to the second question; the first I need to think about for a second 🙂
What I'd try: 1. If predicting the occurrence of the event (but not the size) is sufficient for your task: I'd start with a simple classifier; i.e. LightGBM based on a few features. 2. If you want a notion of the size of the event too: I'd try a univariate probabilistic model, I'd use neuralforecast->NHITS (you could use this tutorial) in combination with a probabilistic loss that aims to capture the rare events. Try to see if you can at least see a confidence interval that becomes wider- based on only the picture I've seen it may be very hard to predict the exact value of the spike, so a probabilistic forecast (i.e. predicting 0.9 or 0.95 or even 0.99 quantile, e.g.
[MQLoss with levels=[95, 99]
) makes more sense to me; hopefully you'll see that the confidence interval becomes much wider at the observed peak. 3. For the multivariate case, you could use PatchTST (which you already did), but then in combination with a MQLoss function as I described under 2. Finally, we have a multivariate architecture (TSMixer) soon to be released (next 1-2 weeks), which I think would help you with this problem. Hope this already helps
r
Thank you. I will have a look at it tomorrow. What I had in mind is the idea of changing the head of your deep learning time series forecaster to predict the likelihood of the next step(s) being outside of a confidence interval. “Anomaly forecasting” 😅 As the only task the model should learn is forecasting anomalies 1/0. It sounds like it’s a similar concept as what you mentioned. As changing the loss to reflect this likelihood sounds similar, I just don’t know so well what it would do to your model. And what effect this imbalance of anomalies would have on your modified loss
We mostly care about having a low recall then
w
The price, especially those spikes, might be driven by demand, generation, as well as transmission congestion or outage. And these might be further affected by weather and temporal variables. So in my opinion, adding some exogenous features might be an option. btw, i think changing the scaler type might help as well. Sorry i am new to this area and am unable to provide very useful suggestions.
r
Any input is helpful! Thank you. I am also wondering about the difference between multivariate modeling and using exogenous features. It sounds like I should not go for multivariate but treat all these other time series as exogenous variables right? Because I don’t care about forecasting those. Will the effect on forecasting the price be different?
w
If the electricity price is the only variable you want to forecast, then univariable forecast with exogenous features makes sense to me in my opinion. As for multivariable forecasting, it only depends on the model itself. For example i heard PatchTST cannot model the correlations between variables well, and PatchTST in neuralforecast currently does not support exogenous variables. Again, i am new to machine learning and deep learning, correct me if i am wrong.
only - really*
r
Just realized PatchTST is channel-independent, which means it is actually univariate 😅😅😅😅
The TimeXer model for which the paper just has been released fits really well to my setting https://arxiv.org/pdf/2402.19072v1.pdf
o
Thanks for the reference! Just for my understanding - what makes you particularly like this model? (as basically any model that has been released in the last 10 years has the same functionality as what these authors claim - i.e. any model can support exogenous and most - if not all - neural models support this by default)
👍 1