method=‘independent’: prior, model and consensus precision
Scope and names
The reference calls this method independent. Its implementation is IndependentBayesianRegularizedPredictionSignal in Exabel’s Bayesian signal. postforecast.bayesian_kpi_predictions implements its mathematics over a tidy estimate panel. It reads the panel at an explicit UTC as_of moment.
Independent: Combines a prior and independent noisy readings using inverse variances.
Bias correction: An option applied to consensus levels before either method.
Dispersion/count weighting: Options for independent consensus precision.
Backtests/predictions/combined: Output selections, not different estimators.
The existing BayesianPosterior remains the earlier tutorial API. Its input is a prepared subject frame. It has different missing-model-precision semantics and uses underscore column names. The complete reference workflow uses the original hyphenated output names and stdev_weighted_consensus argument.
Growth coordinates
Let \(y_t\) be realized KPI level and \(b_t\) the latest nonmissing actual with a period end strictly before \(t\). For model level \(a_t\) and consensus level \(c_t\):
Realized growth: The historical prior sample is \(g_t=y_t/y_{t-1}-1\).
Missing observations: Only aligned nonmissing observations enter an error sample.
Training start:start_date truncates levels before growth is calculated.
History selection: Historical model and consensus observations are anchored before their actual’s first publication; later revisions cannot change them.
Prior and error precision
With \(n\) realized growth observations, the prior is
At least \(\max(2,\texttt{minimum_observations})\) observations are needed for this sample variance. Source precision uses mean squared error, not a centered sample variance:
Zero realized growth is excluded from that relative-error sample. Each source needs minimum_observations errors; its default is 3 and its permitted minimum is 1. The prior still needs at least two realized growth observations.
Backtests: Expanding prior and error moments are shifted by one observation. A target’s actual and error cannot affect its own posterior. Moments are aligned to the original observation indexes; missing historical precisions are not filled forward.
Predictions: The complete realized training sample is fitted once and its moments are held fixed across the forward horizon.
Combined: Each output column takes historical values strictly before that column’s first nonmissing forward value, then appends its forward values.
Independent posterior
Assuming an independent normal prior and normal observations:
Adding an independent precision reduces the computed variance under these assumptions. It does not guarantee better predictive accuracy with correlated errors or misspecified variances.
Model excluded:include_model=False uses \(T=\tau_0+\tau_C\) and reports model weight zero. Model growth and model precision cannot be requested.
Missing historical model precision: An enabled model with unavailable precision prevents a historical posterior.
Missing fixed model precision: The reference’s forecast update becomes prior plus consensus. Its diagnostics still report missing model precision, total precision, weights and interval. The prediction can therefore exist without an interval. This asymmetry is preserved and tested.
Missing prior or consensus precision: No posterior is available.
Consensus dispersion and analyst count
With positive level-space dispersion \(d_t\) and positive contributor count \(n_t\):
Adjustment: For \(\lambda\in[0,1]\), \(c_t^*=c_t/(1+\lambda\beta_t)\).
Invalid scale: An unavailable or nonpositive scale retains the original consensus, matching the reference’s declared bias behavior.
Diagnostic:consensus-bias-pct is \(100\beta_t\), in percentage points.
Zero strength: Requesting the bias diagnostic still runs the filter when \(\lambda=0\); consensus remains unchanged.
Forecast hold: The reference shifts errors on the joint historical index, then forward-fills the filtered bias onto consensus timestamps. Its final realized error is not assimilated again at the first forecast timestamp.
Both methods use \(c^*\) for the consensus growth and error history. Neither reinterprets dispersion around the adjusted level.
Student-t intervals
The interval is a calibrated Student-t band around posterior growth, using the normal update’s standard deviation:
Growth bounds:posterior-growth-lower and posterior-growth-upper.
Level bounds: Convert both with \(b_t(1+\theta)\), then sort them so a negative base cannot reverse prediction-lower and prediction-upper.
Interpretation: These configured heavy-tailed intervals are not the conjugate Gaussian posterior’s ordinary credible interval.
Reference output names
Output
Quantity
prediction
\(b_t(1+\widehat\theta)\)
prediction-lower
Lower sorted level bound
prediction-upper
Upper sorted level bound
model
Raw model level
consensus
Raw consensus level
posterior-growth
\(\widehat\theta\)
posterior-growth-lower
\(\theta_L\)
posterior-growth-upper
\(\theta_U\)
model-growth
\(x_A\)
consensus-growth
Growth of adjusted consensus
actual-growth
Realized growth
prior-mean
\(\mu_0\)
prior-precision
\(\tau_0\)
model-precision
\(\tau_A\)
consensus-precision
\(\tau_C\)
total-precision
\(T\)
posterior-growth-stdev
\(T^{-1/2}\)
prior-weight
\(w_0\)
model-weight
\(w_A\)
consensus-weight
\(w_C\)
consensus-stdev
Level dispersion
consensus-stdev-growth
\(d_t/\lvert b_t\rvert\)
consensus-count
Analyst count
adjusted-consensus
\(c_t^*\)
consensus-bias-pct
\(100\beta_t\)
Growth outputs are fractions, not percentages. Only consensus-bias-pct uses percentage points. Raw levels and consensus-derived levels remain distinct from relative outputs; requesting a level may have licensing implications for the caller’s publication policy.
Publication-relative reads
Fixed horizon:relative_to="publish", relative_days=h, with \(h\le0\). The pd alias is accepted. Omitting the horizon selects zero days.
Latest horizon:relative_days="latest" derives the day offset between the latest live model revision and that period’s supplied publication date.
Missing latest horizon: A company without a usable live prediction or publication date receives latest_horizon_unavailable; other companies continue.
Reading boundary: Model and consensus values must be known strictly before the smaller of the explicit as_of and the horizon cutoff. This package preserves its exclusive timestamp contract; Exabel’s external date-version loaders are not part of the numerical port.
Delayed history: Earlier actuals must also have been published by the reading cutoff; unavailable history refuses the row and its diagnostics.
Supplied schedule: Pass subject keys and UTC publication_date in publications. Schedule provenance remains the caller’s responsibility.