Time series Prediction: inference process

Hello everyone,
I’m pretty new in Machine learning world but i try to use the time series transformer by following the blog presented here: Probabilistic Time Series Forecasting with :hugs: Transformers (huggingface.co) on data from yahoofinance.
Doing so, as my results looks a bit suspicious, i’m analysing more in depth the code provided in the blog and i have some general questions:

  • what is the method generate providing as results? why do we take the median of the prediction? does all the provided prediction do have the same probability?
  • Is the inference step done on the test_dataset done only once for the prediction_length? starting at the end of the train_dateset? I’m a bit lost on this part. In my problem i would like to be able to perform it on a rolling window basis ( re-using the last observations in the test dataset).
  • i can see also that the past_length = config.context_length + max(config.lags_sequence) but if i read the comment i would have written past_length = max(config.context_length, max(config.lags_sequence))
    -in the blog, mutiple timeseries are provided to the model but how many model are then created? one fore each time series? or one unique one valid for all the time series provided? I ask this because i provided 13 stocks and i have the feeling the predictions done are always kind of global trend.

If one of you can help me with any of these questions, it would really help me.
I have others questions or grey points on my understanding of it but for now Chat GPT and HuggingChat provide me impressive help.