facebook / facebook/prophet

shape of m.predictive_samples

未關閉
#1,719 5 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
20.4k
分支
4.6k
平均合併
19 小時 52 分鐘
30 天內合併 PR
1

描述

The doc string for `predictive_samples` states: `The shape of each output will be (nforecast x nsamples), where nforecast is the number of points being forecasted (the number of rows in the input dataframe) and nsamples is the number of posterior samples drawn. This is the argument uncertainty_samples in the Prophet constructor, which defaults to 1000.`
https://github.com/facebook/prophet/blob/e41ed25646f44f713c110c30c07c678e4a07728e/python/fbprophet/forecaster.py#L1402
This is correct if `mcmc_samples=0`. However, if `mcmc_samples` is anything else, then the `nsamples` element of `predictive_samples` is not equal to `uncertainty_samples`. Here are some examples:

These ones match the doc string, that `nsamples` will equal `uncertainty_samples`:
`Prophet(uncertainty_samples=10, mcmc_samples=0)` --> `nsamples` = 10
`Prophet(uncertainty_samples=100, mcmc_samples=0)` --> `nsamples` = 100

But these ones don't match:
`Prophet(uncertainty_samples=10, mcmc_samples=2)` --> `nsamples` = 12
`Prophet(uncertainty_samples=10, mcmc_samples=3)` --> `nsamples` = 16
`Prophet(uncertainty_samples=10, mcmc_samples=4)` --> `nsamples` = 16
`Prophet(uncertainty_samples=10, mcmc_samples=20)` --> `nsamples` = 40

I don't see the pattern. How is `nsamples` calculated?

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。