-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multivariate modeling #49
Comments
Thanks for the interest in taking this on! Here are my current thoughts. Simultaneous models
The two ways y_1(t) and y_2(t) can be related are:
We could do 1. pretty easily in Stan, but the benefits for sharing the parameters would be small unless you have many time series (I'd say at least 5-10). Hierarchy of time series
In this case there's a hierarchy of time series. So it's a bit simpler (assuming you know the order):
This strategy requires more bookkeeping and model fits, whereas the first strategy everything would be done in one fitting step. Curious if @bletham has thoughts. |
I think that handling this with a hierarchical prior for each parameter could work really well in some situations but I see two potential complications. The first is that I do not expect MAP estimation to perform well with the hierarchical model, so we'd have to do MCMC which can be slow. The second, and more serious, is that putting a hierarchical prior on a parameter (e.g. a seasonality coefficient) implies that we think they should be similar between the two time series, i.e. they are positively correlated. We need a solution that will borrow strength across negatively correlated time series also. So maybe a joint prior for the seasonality coefficients that includes a covariance parameter? I think this would be especially challenging to extend to the changepoint deltas which have a Laplace prior. If we fit a prophet model to
where |
Perhaps I'm thinking about this incorrectly, but I see the outcome as a vector, not as a single value.
where y(t) is a multi-dimensional vector of values (measurements) characterizing traffic levels across all freeway lanes at some point. I think I should probably learn Stan first, and understand why it might/might not be restricted to one-dimensional observations before attempting to "tackle this feature" for prophet. |
Hi, are there any plans to progress development on prophet handling multivariate data? I've found the package to be extremely useful for univariate time series - thanks for your recent release! - and there does seem to be some demand from other users. |
can anyone tell me how to implement hierarchical forecasting using PROPHET in R.i am struggling with the use of time series data frame in prophet function as it throws error. |
any update on this? |
A note about this: There isn't currently a way to do joint forecasts in Prophet. However, there is something you can do if you have time series that you believe are correlated, AND one of them is easier to forecast than the others. A typical setting would be that you have a top-level thing you want to forecast, but then you also want to forecast sub-groups of it (e.g., demographic breakdowns). The top-level thing is often easier to forecast because it has the most data, and noise levels are often lower. If this is the case, then you can try the following procedure:
Something to try, YMMV. The subgroup forecasts may also benefit from reducing the prior scales for both trend changepoints and seasonality, since especially the seasonality will likely be largely captured by the top-level extra regressor. As a side note, I would not expect including forecast A as an extra regressor for forecast B to be beneficial unless A is somehow easier to forecast than B. |
Hi @bletham @seanjtaylor , I'd appreciate your thoughts on the following sequential setup. Consider we have a number of time series Also, would you consider as regressor prophet's forecast or a merge of historical value plus forecasted values. Thanks |
These are both good questions. For the first, I think there are two important things for the inclusion of the extra regressor to be valuable. The first is that it be correlated with the target time series. By this consideration, This is the biggest challenge with having meaningful extra regressors, but is also something that may be satisfied for these sort of hierarchical time series. It seems to often be the case that the top-level time series has more data, less noise, and is easier to forecast. In this case, there can be value to including it as an extra regressor (the actual value will depend on how correlated it is). For your second question, I suspect it would be best to use the Prophet forecast As a note for the future, it will be very useful/important to incorporate the uncertainty in the regressor forecast into the prophet forecast. Conceptually, this is pretty straightforward: When sampling future uncertainty, for each sample use a different sampled draw from the regressor forecast (but ignoring the noise level, which means a change here: https://github.com/facebook/prophet/blob/master/python/fbprophet/forecaster.py#L1330 ). In terms of implementation, this means we'll have to have a way to pass along this uncertainty, or more likely have a specific interface for including a prophet model as a regressor so we can sample directly from it. Related to #442. |
To summarize the above: at this point it's not possible/simple to use prophet to predict more than one series/feature, right? If so, any plans to add this capability? (Example of multiple series/feature: instead of using just the temperature to forecast weather, it would be beneficial, and more accurate, to use other feature such as humidity, pressure, etc) |
@jheffez Correct. If the other humidity and pressure are easier to forecast than temperature than you could include them (and their forecasts) as extra regressors in your forecast of temperature, but there is no way to jointly forecast all three at the same time. This is certainly on the to-do list, but it will require a pretty substantial amount of new modeling and testing, and I don't expect to happen soon. We'll likely first focus on the hierarchical case that I describe in my Oct 16 comment above. |
Regarding the question of hierarchical problems I recently came across this page regarding using pystan for hierarchical/multilevel modeling. I know prophet utilizes stan so perhaps this can provide some ideas? Not entirely sure as Bayesian analysis is not my primary strength. |
It would be interesting to provide an example of modeling time series hierarchy in prophet. |
Hi! I was just wondering if this is being worked on as of 2021, I would love to check the code if possible, thanks a lot for this awesome tool! |
It isn't being worked on, though I know the https://github.com/ourownstory/neural_prophet project (which is a Prophet-style model implemented in pytorch) is currently working on multivariate forecasting and so may be a good place to discuss your use case. |
Yes thank you, in fact they are working on it! ourownstory/neural_prophet#235 |
Hi @bletham, can you review Vonum approach of multivariate? Maybe you can merge both repository and add multivariate capabilities of prophet? See https://github.com/vonum/multi-prophet |
I see from issue #18 that there are no concrete plans yet for prophet to handle multivariate data. I am interested in tackling this feature; any pointers on where to start?
My application area is vehicle traffic. For example, numbers of cars and trucks in each lane moving past a point (yes I also read that sub-daily data is also not yet well supported). While I can predict traffic lane by lane by car by truck, it would make more sense to model all lanes and vehicle types at once, since they are related (lots of trucks in the right lanes means fewer cars in those lanes, more cars in left lanes, etc etc.).
The text was updated successfully, but these errors were encountered: