Closed tommylees112 closed 5 years ago
I understand the uncertainties for FUTURE are based on the following process:
i) trend
has a constant rate (the solid line)
ii) there are S
changepoints in the history (T
timesteps)
iii) therefore, a rate of S/T
changepoints with an average magnitude of $\delta$
iv) given the historical average we simulate this many changes to the trend into the future
How is this done for the data that already exists? for the data that we have fit our model to?
Thanks for your help guys!
@tommylees112 There are three types of uncertainty in the model. The first is future trend uncertainty, which you correctly described. The second is parameter uncertainty, which you also correctly observed is not present because MCMC was not done. The third type, and the source of the uncertainty in the past here, is that there is a noise term in the model. Specifically, the model is
y(t) = trend(t) + seasonality(t) + regressors(t) + noise
where noise ~ Normal(0, sigma)
and the noise variance sigma
is fit to the data. yhat_lower
and yhat_upper
are in the history just the quantiles of that noise distribution.
Data: evi_mean.txt Code:
I understand that the parameters have been fit using the Stan optimisation and so there are no parameter uncertainties estimated. But I have been looking through the code and I don't understand how
yhat_upper
andyhat_lower
are estimated in theforecast
dataframe above. All of the component parts (trend_upper, trend_lower, yearly_upper ...) are constant throughout, so where does this uncertainty come from?Could you let me know how it is calculated and also point me to the function in which it is calculated?
Thanks very much
Tommy