growth_prior

growth_prior(
    estimates,
    as_of,
    *,
    minimum_observations=defaults.MINIMUM_OBSERVATIONS,
    winsorize_fraction=None,
)

Compute the prior on an entity’s own growth from its realised history.

Parameters

Name Type Description Default
estimates pd.DataFrame Long input panel. required
as_of pd.Timestamp The moment to read the panel at. required
minimum_observations int The fewest growth observations that make a prior meaningful; at least two are always required, since a sample variance needs them. defaults.MINIMUM_OBSERVATIONS
winsorize_fraction float | None Share of each tail of realised growth clipped before the mean and variance, each history on its own bounds. None clips nothing. None

Returns

Name Type Description
pd.DataFrame One row per subject present in the panel as of as_of, carrying previous_actual (the latest actual strictly before the subject’s own period_end), prior_growth_mean and prior_growth_variance (the sample mean and variance of sequential realised growth strictly before that period_end) and realised_growth_count. The mean and variance are NaN below the minimum observation count, refusal being the calling method’s decision, not history’s; the count is always the true one.