I have time series data corresponding to different entities. My goal is to train a model on the set of entities I have, and then provided a new entity to predict the whole time series for it.

For example I have:

entity day feature_1 feature_2 target
entity_1 2019-1-1 0.45 0.9 0.40
entity_1 2019-1-2 0.35 0.1 0.60
entity_2 2019-1-1 0.3 0.7 0.25

Provided an entity_3 and feature_1 over 1 year (let's say) the model needs to predict the entire time series over this year. I guess that technically this is not a forecasting problem but I have features across a time period for a new entity I never encountered and I need to predict what the target would be for it across the time period.

Now I am interested to predict the target as proportions using relative features, because the relationship between the feature_1 and the target can change according to the entity.

Now any model I use needs to be able to handle different timeframes, and if the timeline change the distribution of the relative features will change.

By different timeframes, I mean that sometimes the model can be asked to predict the whole time series over 1 year, or 4 month or kind of anything really. Because the entities can behave very differently I can't fit a model for each entity. So I need to have a model able to generalize between these entities.

For example: feature_1 at day 1 can be 1% of the sum of the feature over 1 year, but if my timeline changes to 6 month it can become 2%. Heard it's called compositional data.

So my question is how can I build features that would be relative but can be consistent over different time frames ? So if my model is trained on one year it can also be applied on 6 month ? Or would say I need a model for each time frame (one 3 month, 6 month, a year etc...)

Thanks !!

  • $\begingroup$ What do you mean by "different timeframes"? Do you mean different time granularities? Also, you write you want to predict the target as proportions, but then you only discuss your predictor. Please clarify. $\endgroup$ – Stephan Kolassa Apr 28 at 9:51
  • $\begingroup$ @StephanKolassa, I added some clarification. Does it help ? $\endgroup$ – Yairh Apr 28 at 9:59

I see two or three possibilities.

On the one hand, you can fit a model on the most granular time unit you will encounter, e.g., for days. Then you can aggregate forecasts up to any desired time unit.

On the other hand, as you write, you could fit separate models to each time granularity.

Finally, if you are interested in expectation forecasts, then these should "add up" across time buckets: the sum of seven daily forecasts should be equal to the weekly forecast. You can leverage this by running models on each separate time granularity (whose forecasts will not be coherent), then post-processing the forecasts. This is the MAPA algorithm proposed by Kourentzes et al. (2014).

refers to compositional targets. I don't see how your targets are compositional, but if they are, this earlier thread may be helpful.

  • $\begingroup$ If I understood right the #compositional-data concept - my target is also the proportion of the actual value relative to the sum over the overall period. updated the table for more clarity $\endgroup$ – Yairh Apr 28 at 10:57

Your Answer

