Using plates when forecasting data with a tree structure

Hi,

I was following through the hierarchical forecasting example: http://pyro.ai/examples/forecasting_iii.html and the example assumes that each axis in the dataset corresponds to a plate in the data:

ie:

origin_plate = pyro.plate("origin", num_stations, dim=-3)
destin_plate = pyro.plate("destin", num_stations, dim=-2)

This implicitly assumes that the data is “square” - ie, we have data from every station to every station. How are we supposed to extend the model if that assumption is no longer true?

As an example - suppose you are forecasting GDP, broken down by county OR broken down by service sector (ie, you don’t have the cartesian product of country and service sector). What’s the idiomatic way to write that using plates and structuring the data axis to make model inference painless?

@Federico_V I think this example in M5-Starter_Kit will be helpful for you. There, we have plates for stores, products, departments,… and the numbers of products in each department are different.

2 Likes

Thanks, that looks very helpful!