facebook / facebook/prophet

shape of m.predictive_samples

オープン
#1,719 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
20.4k
フォーク
4.6k
平均マージ
19時間 52分
マージ済み PR(30日)
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 を短くまとめたダイジェスト。