# Multivariate time series model vs. Univariate time series model with categorical variable

Let's say I want to forecast sales of several products in a grocery store, which are green apple, red apple, blue berry, strawberry.

My question is, how do I know if I should model this as a multivariate time series (like VAR) or I should go with an univariate time series model with an extra categorical variable indicating the 4 types of fruit?

• You could also thonk about it as hierarchical forecasting. Search this site May 28, 2018 at 12:00
• Can you attach the link please? May 30, 2018 at 22:29
• May 31, 2018 at 21:38

With sufficiently fancy grouping of the data by the categorical variable, and allowing the error terms the right structure, the two methods could be made to be identical (I think). But it's certainly much easier to think about and to implement as a multivariate time series.

I might be looking too much into the details here, but in order to

forecast sales of several products

you would need an explicit series for each of those products, hence a multivariate model. Alternatively, if you were to forecast total number of units sold, you could group it all up in one equation, in which case you could just label all 4 of them as "fruit" and not care about the type (unless there are other types of fruit in your catalog).

(Late to the game, answering for the benefit of future visitors to the SE).

In this case you should use neither a multivariate time series model, nor a univariate model with causal variables. What you need is a hierarchical model for grouped time series.

In your case, you would forecast each product separately, and then group the products into a hierarchy of products: Red apples and green apples fall into a group called apples, blue berries and strawberries into a group called berries, etc..and then put apples and berries into a group called fruit, etc...the you can reconcile the forecasts at different levels using top down or bottom up approaches.

How you group your series will be based on domain knowledge and business considerations.