hi,
I’ve read the paper and a part of the source code, but I still don‘t understand how to forecast the ‘yhat_upper’ and ‘yhat_lower’? anyone willing to share their own opinions?
Do you mean how they are estimated?
There is a basic description of it in the documentation here: https://facebook.github.io/prophet/docs/uncertainty_intervals.html
There are three components to the uncertainty (yhat_upper and yhat_lower): observation noise, parameter uncertainty, and future trend uncertainty.
Observation noise is inferred from the data since each point is assumed to have normal observation noise (https://github.com/facebook/prophet/blob/master/python/stan/unix/prophet.stan#L123).
Parameter uncertainty is only estimated if you do MCMC. This is described in the documentation link above, but basically yhat is estimated under each MCMC sample and we can look at the distribution of estimates to get the _lower and _upper bounds. (By default it is an 80% interval, this is set with the interval_width input argument).
Trend uncertainty is a bit more complicated; it is described at a high level in the documentation link above. It is described mathematically in Section 3.1.4 of the paper, and then in code the simulated future trend changes are done here: https://github.com/facebook/prophet/blob/master/python/fbprophet/forecaster.py#L1287 . As with MCMC, here we sample a whole bunch of future yhats and then take quantiles of that distribution to get _lower and _upper. (By default 80%).
@bletham thanks for your answer ^_^ ~
Another question: y_lower and y_upper calculated by TPlower_p and TPy_upper in the uncertainty_samples (by default 1000).
lower_p = 100 * (1.0 - self.interval_width) / 2
upper_p = 100 * (1.0 + self.interval_width) / 2
in code :
https://github.com/facebook/prophet/blob/master/python/fbprophet/forecaster.py#L1233
however, how to calculate 1000 parameters in the uncertainty_samples ?
why does Prophet get the uncertainty interval in this way?
The uncertainty_samples is needed because Prophet uses Monte Carlo sampling to simulate future trend changes. The trend uncertainty thus relies on having a large-ish number of these simulations from which we can compute the lower_p and upper_p quantiles.
just wanted to comment that @bletham has done an excellent job answering questions and prophet has been the best forecasting tool I have come across. I use it as my baseline for forecasting and have yet found another method that beats it.
Most helpful comment
just wanted to comment that @bletham has done an excellent job answering questions and prophet has been the best forecasting tool I have come across. I use it as my baseline for forecasting and have yet found another method that beats it.