facebook / facebook/prophet

shape of m.predictive_samples

Aperta
#1,719 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
20.4k
Fork
4.6k
Merge medio
19h 52m
PR unite (30g)
1

Descrizione

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?

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.