uncertainty_intervals.md (prophet-1.1) | : | uncertainty_intervals.md (prophet-1.1.1) | ||
---|---|---|---|---|
skipping to change at line 51 | skipping to change at line 51 | |||
By default Prophet will only return uncertainty in the trend and observation noi se. To get uncertainty in seasonality, you must do full Bayesian sampling. This is done using the parameter `mcmc.samples` (which defaults to 0). We do this her e for the first six months of the Peyton Manning data from the Quickstart: | By default Prophet will only return uncertainty in the trend and observation noi se. To get uncertainty in seasonality, you must do full Bayesian sampling. This is done using the parameter `mcmc.samples` (which defaults to 0). We do this her e for the first six months of the Peyton Manning data from the Quickstart: | |||
```R | ```R | |||
# R | # R | |||
m <- prophet(df, mcmc.samples = 300) | m <- prophet(df, mcmc.samples = 300) | |||
forecast <- predict(m, future) | forecast <- predict(m, future) | |||
``` | ``` | |||
```python | ```python | |||
# Python | # Python | |||
m = Prophet(mcmc_samples=300) | m = Prophet(mcmc_samples=300) | |||
forecast = m.fit(df).predict(future) | forecast = m.fit(df, show_progress=False).predict(future) | |||
``` | ``` | |||
This replaces the typical MAP estimation with MCMC sampling, and can take much l onger depending on how many observations there are - expect several minutes inst ead of several seconds. If you do full sampling, then you will see the uncertain ty in seasonal components when you plot them: | This replaces the typical MAP estimation with MCMC sampling, and can take much l onger depending on how many observations there are - expect several minutes inst ead of several seconds. If you do full sampling, then you will see the uncertain ty in seasonal components when you plot them: | |||
```R | ```R | |||
# R | # R | |||
prophet_plot_components(m, forecast) | prophet_plot_components(m, forecast) | |||
``` | ``` | |||
```python | ```python | |||
# Python | # Python | |||
fig = m.plot_components(forecast) | fig = m.plot_components(forecast) | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added |