Repository navigation
v0.7.0
Full Bayesian fitting, like Python's mcmc_samples, for the main model and for regressors
forecast by their own models. Code that only fits MAP models works as before at runtime, but code
that reads optimizer fields from a FittedProphet must now narrow it first.
Added
-
Full Bayesian fitting.
fit(rows, { mcmc: { samples, seed } })samples the posterior with
a port of Stan 2.37.0's adaptive NUTS sampler, like Python'smcmc_samples, for flat, linear
and logistic growth. It works with regressors forecast by their own models, and in
crossValidate,searchModels,evaluateHoldout,forecastand anomaly detection.chains
andwarmupdefault to Python's 4 andsamples / 2.- Forecasts use the posterior means.
predictWithIntervalsrunsceil(samples / draws)
futures per draw and adds each component's range over the draws, and
getRegressorCoefficientsadds each coefficient's 80% range. - Saved models keep every draw, and
fitSummary.diagnosticsreports divergences, tree-depth
hits, R-hat, effective sample sizes and step sizes. - New models are
"flat-mcmc","linear-piecewise-mcmc"and"logistic-piecewise-mcmc". A new
FittingErrorreason,"sampling-limit", bounds the chains, draws and kept values.
- Forecasts use the posterior means.
-
Sampled regressor models. A regressor's
predictoroptions takemcmc, like
mcmc_samplesin Python'sregressor_predictor, so the model that forecasts a regressor can
sample its posterior too, with its own seed, whether or not the main model samples. Its draws
widen the main model's ranges, and saved models keep them. See
Forecasting a regressor. -
A new
effect-prophet.wasm.componentRangesspan, andmcmc.*attributes on the engine's fit
and simulation spans. See the tracing guide. -
Docs for agents and tools. The docs site publishes a Markdown copy of every page,
llms.txt,llms-full.txtand a sitemap. -
Did the optimizer finish? Checking the fit
shows how to tell when L-BFGS stopped well short of the optimum, which both libraries can do on
some histories. The warm-start caveat in
Saving and loading models now
explains why logistic refits can break after many new rows.
Changed
FittedProphetnow includes posterior models, whosefitSummarydescribes the sampler rather
than an optimizer, and so doesRegressorModel["model"], for sampled regressor models. Code
that reads optimizer fields such asfitSummary.objectivefrom any fitted model must first
checkisMcmcModel(model), or use the newFittedMapProphettype.isLogisticModeland
FittedLogisticProphetcover logistic models fitted either way.simulationon uncertainty, cross-validation and anomaly results is nowSimulationIdentity,
which addsposteriorSimulationIdentityfor posterior models. Holdout reports accept it as
simulation.algorithm, and theirmodelcan be a posterior summary.
Verification against Python Prophet
- Full Bayesian fitting benchmarks on flat, linear and logistic growth, including a regressor
forecast by its own model, optimized or sampled, against Python Prophet'smcmc_samples. The
two samplers' chains can't match draw for draw, so forecasts must agree within 0.15 of the
narrowest 80% range and every range bound within the variation expected from the posterior's
draws. Both libraries must keep the same number of draws, and divergences and R-hat are
reported. Linear and flat fits take about as long as Python's, and ranges from a posterior are
9–83 times faster, but logistic fits take 3–4 times as long as Python's native CmdStan.
Full Changelog: v0.6.0...v0.7.0