Cohort-Driven Forecasting for Pay-TV and Streaming with Survival Analysis, SARIMA, and Cohort Stacking
The business problem: A multi-product pay-TV operator running a portfolio in transition (a satellite-anchored premium tier in mature decline, a streaming-only tier in growth, and standalone genre packs as part of an unbundling strategy) needs a defensible four-quarter-ahead subscriber forecast. Forecast accuracy directly drives financial guidance, marketing investment allocation, and content acquisition decisions. The default approach across most organizations is a naive run-rate model that takes the current subscriber base, applies a quarterly growth rate from observed trend, and projects forward. That approach systematically misses what actually drives subscriber dynamics: cohort heterogeneity, tenure-based churn, segment mix shifts, and seasonal acquisition cycles.
Why this is hard: Subscriber counts at any point in time are the result of dozens of cohorts at different stages of their lifecycle, each retaining at different rates, plus new acquisitions every quarter that bring in additional cohorts with their own retention dynamics. A single growth rate applied to an aggregate base ignores all of that. When the underlying composition is shifting (which is exactly when forecast accuracy matters most), naive forecasts produce systematic errors that grow worse over the forecast horizon.
Why a cohort-driven architecture: Subscriber forecasting is fundamentally a composition problem, not a single-equation problem. The right architecture decomposes the question into pieces, models each piece with the right tool, and stacks them back into a single inspectable answer. That is what this framework does.
What we built: A complete end-to-end integrated subscriber forecasting framework in Python that composes three methodological building blocks into a single pipeline:
SARIMA gross adds forecast (calendar-time)
|
v
Weibull survival churn dynamics (tenure-time)
|
v
Cohort stacking (segment x tenure mix)
|
v
Final integrated forecast
Each method does the thing it is best at:
- SARIMA captures seasonality and autocorrelation in gross adds, the inflow. Pay-TV has well-documented annual seasonality (NFL and holiday cycles drive Q3/Q4 acquisition spikes, summer is the trough). SARIMA picks these patterns up automatically.
- Weibull survival captures tenure-based churn dynamics. Subscription businesses do not have constant hazard. There is a sharp early-tenure cliff followed by durable late-tenure retention. Different products have different lifecycle shapes, requiring per-segment fits.
- Cohort stacking composes the two: existing observed cohorts age forward through their fitted survival curves, new cohorts (with sizes from SARIMA) enter and age through theirs, and the total is the sum across all cohorts and segments.
The decomposition makes every contribution to the final forecast inspectable. Naive run-rate is included as a comparison baseline that any defensible production method should clearly beat.
Key modeling decisions:
- Composition, not parallel comparison. Each method contributes its specialty. SARIMA forecasts the calendar-time inflow, Weibull captures tenure-time churn, cohort stacking composes them. Running multiple methods in parallel and picking the one with lowest backtest error is a less defensible architecture because it does not tell you why the chosen method works.
- Weibull over exponential. The Weibull form
S(t) = a * exp(-(t/lambda)^k)is preferred over simple exponential decay because subscription businesses do not have constant hazard. The shape parameterkis the difference.k < 1captures the early-tenure cliff (highest force of churn in months 1 to 3, declining sharply afterward),k = 1is constant hazard,k > 1is increasing hazard with tenure. Pay-TV subscribers fit thek < 1profile cleanly. - Per-segment fitting. The three segments have meaningfully different shape parameters in the fitted model (premium bundle k around 0.59, streaming-only tier k around 0.90, genre packs k around 0.56). The data-generating targets in the simulator are slightly different (0.65, 0.80, 0.55) and the recovered values reflect the per-cohort drift, observation truncation, and noise built into the simulation, which is exactly how parameter recovery behaves on real cohort data. Fitting all segments with a single pooled model would produce a blended curve that fits no segment well.
- Variable per-cohort tenure observation. Each cohort is observed from its start through a fixed calendar cutoff (end of Q1 2026, the analytical "today"). The oldest cohort has 39 months of tenure observed, the newest has just entered. This mirrors how real cohort data looks at any analytical snapshot.
- Seasonality in gross adds. Cohort initial sizes vary by calendar quarter (Q4 = 1.20x, Q3 = 1.10x, Q1 = 0.95x, Q2 = 0.85x) reflecting the well-documented pay-TV demand cycle. SARIMA detects and projects this pattern forward.
- Gross adds trend. Gross adds decline approximately 1.5 percent per cohort reflecting market maturation as customers move toward streaming-first plans. SARIMA picks this up alongside seasonality.
- Cohort drift parameter. Each segment includes a small per-cohort retention shift. The premium bundle has negative drift (mature segment, declining product-market fit). The streaming-only tier has positive drift (newer product maturing). The backtest bias direction matches these drift signs exactly. That is how you confirm cohort drift is real and not noise.
Inputs to the model: Cohort-level: segment, cohort start quarter, tenure month, observed active subscriber count. Derived: per-segment Weibull survival parameters, historical quarterly gross adds time series, cohort age trajectories. Forecast horizon: four quarters (Q2 2026 through Q1 2027).
What the model finds: Per-segment Weibull shape parameters confirm the early-tenure cliff is segment-specific. Genre Packs has the sharpest cliff (k around 0.56), Signature a moderate cliff (k around 0.59), BYOD closer to constant hazard (k around 0.90). The integrated forecast projects total active subscribers growing from approximately 323K (today, end of Q1 2026) to approximately 395K by Q1 2027. The growth is driven by durable Signature retention, BYOD's positive cohort drift, and SARIMA's forecast of continued seasonal acquisition. The naive baseline projects a decline to approximately 304K because it extrapolates only the recent gross adds trend without accounting for the durable existing subscriber base or structural BYOD growth. The roughly 92K gap between integrated and naive forecasts at Q1 2027 is the value of decomposition.
On forecast accuracy: The backtest holds out the last four cohorts and predicts their full retention curves using parameters fit only on the earlier nine cohorts. Average MAPE across segments lands around 8 percent, with bias by segment that mirrors the cohort drift baked into the data. Signature has negative bias (the model overshoots when applied to declining newer cohorts), BYOD has positive bias (the model undershoots when applied to improving newer cohorts), Genre Packs is approximately stable. The bias direction is the diagnostic. It tells you the cohort drift would need to be modeled explicitly in production rather than treated as noise, which is exactly what a hierarchical Bayesian survival model would do.
On the +30 percent gap to naive: Three structural effects the naive method misses produce the gap. SARIMA's seasonally-aware gross adds forecast (vs. naive trend extrapolation), the durable existing subscriber base (vs. naive treatment of base as monolithic), and structural BYOD growth (vs. naive blindness to segment mix). Note that with shorter training history (3 years instead of the more typical 5 to 7), the gap is amplified compared to what a longer-history fit would produce. The methodology argument holds at any positive gap.
The dashboard: Nine panels organized in three rows. Row one shows per-segment cohort retention curves (the foundation of the analysis). Row two shows the methodology in action: tenure-based hazard functions, the SARIMA gross adds forecast, and the backtest predicted-vs-actual scatter. Row three shows the forecast composition: per-segment four-quarter forecast, scenario overlays for pricing shock, promo intensity, and competitive entry, and the punchline panel comparing the integrated forecast against the naive baseline.
What a production version would add: Hierarchical Bayesian survival model with cohort-level random effects (so newer cohorts with limited data borrow strength from mature cohorts), Cox proportional hazards model with covariates for promotional acquisition, channel, geography, and tenure stage, SARIMAX with explicit covariates for marketing investment and content release calendar, automated retraining pipeline (weekly via Databricks or Snowflake), forecast accuracy monitoring with alerting on MAPE drift, a Migrations module for cross-product movement between tiers, a Reconnects module for win-back dynamics, full Bayesian uncertainty quantification, and a scenario-planning UI for executive use.
Subscriber volume forecasting is one of the highest-leverage and most consequential analytical functions in subscription businesses. Forecasts drive financial planning, marketing investment, content acquisition decisions, and executive expectations. When the forecast is wrong, the cost carries forward: a wrong forecast in Q1 leads to wrong decisions in Q2, which produces a worse forecast in Q3. Most organizations default to naive run-rate forecasting because it is simple, transparent, and seemingly "good enough", except that it is not, especially during periods of portfolio transformation when cohort dynamics matter most.
This project builds a complete end-to-end integrated subscriber forecasting framework on synthetic but realistic data. The integrated architecture composes SARIMA gross adds forecasting, Weibull survival modeling, and cohort stacking into a single pipeline. Each method handles the piece it is best at. SARIMA captures calendar-time seasonality in inflow, Weibull captures tenure-time churn dynamics, cohort stacking composes them. Naive run-rate is included only as the comparison baseline that any defensible method should clearly beat.
The methodology mirrors current practice at companies running rigorous subscription forecasting at scale.
| Area | Specifics |
|---|---|
| Survival analysis | Weibull and exponential survival fitting, R-squared fit-quality comparison, hazard function decomposition, shape parameter interpretation |
| Cohort modeling | Cohort decomposition, tenure-based decay, cohort-over-cohort drift, retention spaghetti charts, variable-tenure cohort observation |
| Time-series modeling | SARIMA(p,d,q)(P,D,Q,s) fitting on quarterly gross adds with seasonality, AIC/BIC/Ljung-Box diagnostics, forecast intervals |
| Subscription forecasting | Integrated forecasting (SARIMA + survival + stacking), gross adds projection with secular trend, retention envelope construction |
| Compositional modeling | Each method solving its own piece, fed into the next, production-grade architecture rather than parallel-method comparison |
| Model validation | Hold-out backtesting, MAPE and bias decomposition by segment, residual analysis, cohort drift detection |
| Scenario analysis | Pricing shock, promotional intensity, competitive entry overlays, forecast envelope construction with cumulative multipliers |
| Statistical modeling | Nonlinear least squares curve fitting (scipy.optimize.curve_fit), bounded parameter estimation, state-space model fitting (statsmodels.SARIMAX) |
| Visualization | Nine-panel analytical dashboard, cohort spaghetti plots, hazard curves, gross adds forecast bars with confidence intervals, integrated vs. naive forecast comparison |
| Communication | Executive-ready findings, methodology documentation, production roadmap, defensible assumption framing |
A pay-TV operator running a multi-product portfolio in transition needs to forecast active subscriber volume four quarters ahead. The portfolio has three distinct product tiers:
| Segment | Description | Acquisition Trajectory | Retention Profile |
|---|---|---|---|
| Signature | Premium satellite + streaming bundle | Mature, declining as customers shift to streaming-first plans | Long lifetime, durable late-tenure (k around 0.59) |
| BYOD | Streaming-only tier delivered via app on customer-owned devices | Growing, central to the streaming-first product pivot | Moderate lifetime, improving cohort-over-cohort (k around 0.90) |
| Genre Packs | Standalone themed bundles (sports, language, niche) | Volatile, often event-driven | Short lifetime, sharp early-tenure cliff (k around 0.56) |
A naive run-rate forecast (take the current total subscriber base, apply a quarterly growth rate from observed recent trend, project forward) produces a single number that obscures all of this complexity. The integrated approach decomposes the forecast into its proper components, lets each be modeled with the right tool, and stacks them back into a single inspectable answer.
Historical cohort data
- 3 segments x 13 quarterly cohorts
- Variable tenure observed per cohort (newest: 0 months, oldest: 39 months)
- Quarterly seasonality + secular trend in gross adds
| |
v v
Weibull survival fit Historical gross adds series
per segment extracted from cohort data
-> alpha, lambda, k -> quarterly time series
| |
| v
|
| SARIMA(1,1,1)(1,1,1,4) fit
| on gross adds time series
| -> seasonal + trend model
|
| |
| v
|
| Forecast next 4 quarters of
| gross adds (Q2 2026 - Q1 2027)
| allocated by recent share
|
v v
Cohort stacking forecast loop:
For each forecast quarter q:
active(q) = SUM over EXISTING cohorts of:
initial_size * S(age_at_q)
+ SUM over NEW cohorts entering Q1..q of:
sarima_gross_adds_q * S(age_at_q since entry)
This composes calendar-time inflow with tenure-time churn.
|
v
Integrated forecast output
+ scenario overlays (pricing, promo, competitive)
+ naive run-rate baseline for comparison
Cohort observations across:
- 3 product segments (Signature, BYOD, Genre Packs)
- 13 quarterly cohorts (Q1 2023 through Q1 2026)
- Variable tenure per cohort: oldest = 39 months, newest = 0 months (just entered)
- Fixed observation cutoff: end of Q1 2026 (anchored at "today")
For each (segment, cohort, tenure_month) triple, the simulator generates:
S(t) = alpha * exp(-(t/lambda)^k) * (1 + drift * cohort_index) * (1 + epsilon)
Initial cohort size:
initial_size = base_size * seasonality_factor * trend_factor * (1 + epsilon)
where seasonality_factor in {Q1: 0.95, Q2: 0.85, Q3: 1.10, Q4: 1.20}
and trend_factor = (1 - 0.015) ^ cohort_index
This produces realistic data with both annual seasonality and a downward gross adds trend, plus per-segment cohort drift in retention quality.
For each segment, the model fits both a Weibull survival function and an exponential survival function via nonlinear least squares on the pooled cohort data, then compares fit quality:
Weibull: S(t) = alpha * exp(-(t/lambda)^k) (3 parameters)
Exponential: S(t) = alpha * exp(-beta * t) (2 parameters; equivalent to Weibull with k=1)
The Weibull shape parameter k is the difference:
k value |
Hazard pattern | Subscription interpretation |
|---|---|---|
k < 1 |
Decreasing hazard | Early-tenure cliff; survivors are durable |
k = 1 |
Constant hazard | Equivalent to exponential |
k > 1 |
Increasing hazard | Aging effect (rare in subscriptions) |
In the synthetic data, all three segments fit with k < 1 cleanly. The Weibull R-squared is at or above 0.996 across segments. Exponential R-squared lands around 0.94 to 0.99 depending on how sharp the early-tenure cliff is. Genre Packs (sharpest cliff) shows the biggest Weibull-vs-exponential gap. This comparison is the empirical justification for using Weibull over exponential.
h(t) = (k/lambda) * (t/lambda)^(k-1)
The hazard at tenure t is the instantaneous rate of churn given survival to t. For k < 1, hazard is highest at small t and decreases monotonically (the early-tenure cliff). The decomposition makes the lifecycle pattern visible in a way that the survival curve alone obscures.
For each cohort start quarter, sum initial cohort sizes across segments to produce a quarterly gross adds time series. With 13 cohorts, this gives 13 quarterly observations of historical gross adds inflow. That is the time series SARIMA fits on.
SARIMAX(1,1,1)(1,1,1,4)
(p,d,q) = (1,1,1): ARMA(1,1) on first differences of the series.(P,D,Q,s) = (1,1,1,4): Seasonal ARMA(1,1) with period 4 (annual seasonality on quarterly data).
This captures both short-run autocorrelation and the annual seasonal cycle. SARIMA forecasts the next four quarters of total gross adds with confidence intervals. The total is allocated to segments via recent observed segment shares (last four cohorts).
Diagnostics reported: AIC and BIC for model selection, Ljung-Box test on residuals at lag 4 (a p-value above 0.05 means residuals look like white noise, indicating the model has captured the structure). With 13 quarterly observations the fit is necessarily noisy. In production with longer history (40+ quarters), order selection via grid search using AIC/BIC and per-segment SARIMA fits would be the endpoint.
Confidence intervals on short histories: Raw posterior intervals from statsmodels are very wide on 13 observations with seasonal differencing. For dashboard visualization the intervals are capped at plus or minus 30 percent of the point forecast. The raw posterior is still available via fitted_model.get_forecast() if needed.
At each forecast quarter q (= 0, 1, 2, 3 for a four-quarter horizon):
active_subs(q) = SUM over EXISTING cohorts of:
initial_size_cohort * S(age_at_q | segment_params)
+ SUM over NEW cohorts entering at quarters 0..q of:
sarima_forecast_gross_adds_for_segment_q *
S(age_at_q since cohort entry | segment_params)
The first term ages all observed cohorts forward using their segment's fitted survival curve. The second term adds new cohorts entering during the forecast window, with sizes drawn from SARIMA's gross adds forecast.
The total forecast is the sum across segments. The decomposition makes the contribution of each segment, each cohort, and each tenure stage explicit and inspectable.
Practical note: the existing 13 cohorts contribute roughly 66 percent of the Q1 2027 forecast total. New cohorts contribute the remaining 34 percent. So a 10 percent SARIMA error on gross adds becomes maybe a 3 to 4 percent error on total active subs. The cohort stacking architecture is partially robust to gross adds forecast error precisely because the existing base contributes a larger share than the new inflow on short-horizon forecasts.
The model trains on the first nine cohorts and generates predicted retention curves for the last four cohorts (held out). For each held-out (cohort, tenure_month) observation, predicted vs. actual is compared:
MAPE_segment = mean(|actual - predicted| / actual) * 100
bias_segment = mean((actual - predicted) / actual) * 100
Average MAPE across segments is around 8 percent. The per-segment bias is informative. Signature has negative bias (model trained on better-retaining older cohorts overshoots when applied to declining newer cohorts), BYOD has positive bias (the reverse pattern). The bias direction matches the cohort_drift parameter sign in the data generator exactly. Signature drift is -1.8 percent per cohort, producing negative bias. BYOD drift is +2.2 percent per cohort, producing positive bias. This is how you confirm cohort drift is real, not noise. It also tells you cohort drift would need to be modeled explicitly in production rather than treated as noise.
Three scenarios beyond baseline are constructed by applying cumulative quarter-by-quarter multipliers. All three use the same mechanic, a quarterly multiplier sequence applied to the baseline forecast, telling three different stories about what hits the business:
| Scenario | Q1 mult | Q2 mult | Q3 mult | Q4 mult | Story |
|---|---|---|---|---|---|
| Pricing shock | 0.93 | 0.90 | 0.90 | 0.90 | Two quarters of elevated churn from price increase reaction; churned subs do not return so the deficit carries forward |
| Promo intensity | 1.03 | 1.01 | 0.97 | 0.94 | Acquisition boost early, but worse retention from low-quality acquisitions catches up |
| Competitive entry | 0.97 | 0.94 | 0.91 | 0.88 | Sustained roughly 3 percent retention loss that grows quarter by quarter as more subs migrate |
In a production version these would be elasticity-based (price elasticity, competitive elasticity, promo response curves) with confidence bands, not fixed multipliers.
The naive baseline takes the most recent observed total subscriber count and applies a quarterly growth rate computed from year-over-year change in early-tenure cohort sizes (year-apart comparisons avoid seasonal contamination).
It is the worst method for any horizon longer than one quarter, but it serves as the floor: any reputable method should clearly beat it. The integrated forecast clearly beats it, and the gap is the value of the integrated architecture.
(Based on synthetic simulation. Results are illustrative of model behavior.)
| Metric | Value |
|---|---|
| Today (observation cutoff) | end of Q1 2026 |
| Survival fit R-squared (Weibull, all segments) | at or above 0.996 |
| Weibull shape parameter, Signature | k around 0.59 |
| Weibull shape parameter, BYOD | k around 0.90 |
| Weibull shape parameter, Genre Packs | k around 0.56 |
| Backtest MAPE (avg across segments) | around 8 percent |
| Forecast horizon | 4 quarters (Q2 2026 to Q1 2027) |
| Today's base (Q1 2026 actual) | around 323K subscribers |
| Q1 2027 integrated forecast | around 395K subscribers |
| Q1 2027 naive baseline | around 304K subscribers |
| Q1 2027 integrated vs. naive gap | around +92K subscribers (around +30 percent) |
| Pricing shock impact (Q1 2027) | around -10 percent |
| Promo intensity impact (Q1 2027) | around -6 percent |
| Competitive entry impact (Q1 2027) | around -12 percent |
Key model insights:
- All three segments have
k < 1(or close to 1 for BYOD), confirming the early-tenure churn cliff is a near-universal feature of subscription dynamics. Operationally, retention investments in the first 90 days have outsized leverage compared to interventions targeting long-tenured customers. - Genre Packs has the sharpest cliff (k around 0.56). By month 6, roughly half the cohort has churned. The product is acquisition-heavy: gross adds are the primary lever, and retention interventions have limited absolute impact because so much of the cohort has already exited.
- Signature has a moderate cliff but very durable late-tenure retention (k around 0.59, large lambda). That is the typical premium-tier pattern where customers who survive the first year are extremely sticky.
- BYOD's positive cohort drift is the most strategically significant signal. Newer cohorts retaining better suggests product-market fit is improving. If this trend continues, BYOD becomes the dominant volume driver in the portfolio over time.
- Backtest bias direction confirms the drift is real, not noise. Signature's
cohort_driftparameter is negative in the data generator, and the backtest bias on Signature is negative (model overshoots). BYOD's drift parameter is positive, and the backtest bias is positive (model undershoots). Sign-by-sign match. - The +30 percent gap between integrated and naive forecasts comes from three structural effects the naive method misses: SARIMA's seasonally-aware gross adds forecast (vs. naive trend extrapolation), the durable existing subscriber base (vs. naive treatment of base as monolithic), and the structural BYOD growth (vs. naive blindness to segment mix). Note that with shorter training history (3 years instead of the typical 5+), the gap is amplified relative to what a longer-history fit would produce. The methodology argument holds at any positive gap.
| Segment | Weibull R-squared | Exponential R-squared | Backtest MAPE | Backtest Bias |
|---|---|---|---|---|
| Signature | 0.996 | 0.953 | around 13.5 percent | around -13.5 percent (overshoots) |
| BYOD | 0.999 | 0.997 | around 7.8 percent | around +7.8 percent (undershoots) |
| Genre Packs | 0.998 | 0.936 | around 2.5 percent | around +2.5 percent (stable) |
The in-sample Weibull fit is excellent (R-squared above 0.99 for all segments), confirming Weibull is the right functional form. The Weibull-vs-exponential R-squared gap is largest for Genre Packs and smallest for BYOD, exactly what the shape parameters predict, since BYOD's k around 0.90 is closest to constant hazard (the exponential limit) while Genre Packs' k around 0.56 is the sharpest cliff. Backtest MAPE is materially higher than in-sample MAPE. That is expected, and the gap reflects cohort drift not modeled explicitly. The bias direction matches the drift direction: Signature's negative bias confirms newer cohorts retain worse than the model expects, BYOD's positive bias confirms newer cohorts retain better. This is exactly the cohort drift problem a hierarchical Bayesian survival model would solve in production. The backtest surfaces the issue cleanly.
The SARIMA(1,1,1)(1,1,1,4) fit produces standard time-series diagnostics: AIC and BIC for model selection, Ljung-Box test for residual whiteness (a p-value above 0.05 at lag 4 means residuals look like white noise, indicating the model has captured the structure in the data). With only 13 quarterly observations, parameter estimates are noisy and confidence intervals are wide. In production with longer history (40+ quarters), order selection via grid search and per-segment fits would be the endpoint.
The nine-panel dashboard (streamvista_cohort_dashboard.png) provides the full visual narrative of the modeling pipeline.
Row 1, Cohort retention foundations: Three spaghetti charts, one per segment, showing every cohort's retention curve color-coded chronologically. Cohort heterogeneity is visible at a glance.
Row 2, Methodology (survival modeling and SARIMA gross adds): The hazard function chart shows segment-specific lifecycle patterns. The SARIMA gross adds panel shows the historical quarterly inflow with the seasonal pattern visible, plus the SARIMA forecast for the next four quarters. The backtest scatter validates predicted vs. actual on held-out cohorts.
Row 3, Forecast composition and the punchline: The forward forecast by segment shows the three different segment trajectories. The scenario overlay shows the forecast envelope under three plausible business scenarios. The punchline panel shows the integrated forecast vs. naive baseline alongside historical observations, with the Q1 2027 gap annotated. That is the value of decomposition.
- Synthetic data: All cohort observations are synthetically generated. In production, each cohort's retention curve would be computed from billing system data: count of active subscribers per cohort per month over time.
- Cohort drift treated as noise in the survival fit: The current cohort and survival model fits one survival curve per segment using pooled data. The backtest bias confirms this absorbs cohort drift as systematic error. A production model would estimate cohort drift as an explicit parameter via hierarchical Bayesian random effects.
- SARIMA orders fixed: The (1,1,1)(1,1,1,4) specification is a reasonable default for quarterly subscription data. Production usage requires order selection via grid search.
- Total + allocation for SARIMA: With 13 quarterly observations, fitting per-segment SARIMA is unstable. We fit one SARIMA on total gross adds and allocate to segments by recent share. In production with longer history, per-segment SARIMA fits would be the endpoint.
- Reconnects and migrations not modeled: The framework forecasts active subscribers from gross adds and churn. It does not model customers who churn and return (reconnects) or customers who move between products (migrations).
- Scenario multipliers are illustrative: Cumulative multipliers for pricing shock, promotional intensity, and competitive entry are placeholder magnitudes. In production, these would be calibrated against historical analogs.
This implementation uses synthetic data and a deliberately straightforward model structure. The path to production-grade subscriber forecasting:
-
Hierarchical Bayesian survival model: Replace per-segment frequentist fits with a hierarchical Bayesian model where cohort-level parameters are random effects nested within segment-level fixed effects. This handles cohort drift explicitly, provides full posterior uncertainty, and lets newer cohorts borrow strength from mature cohorts on shared parameters.
-
Cox proportional hazards with covariates: Move from non-parametric survival fitting to a Cox model with cohort-level covariates (acquisition channel, promotional offer, geography, lifecycle stage). This makes the model causally interpretable.
-
SARIMAX with covariates: Augment the SARIMA gross adds model with explicit covariates for marketing investment, content release calendar, and macro factors. The model becomes SARIMAX (X = exogenous variables) and inherits the same seasonal and autocorrelation structure but is causally interpretable.
-
Per-segment SARIMA fits with longer history: With 40+ quarters of data, fit SARIMA separately per segment rather than total + allocation. Each segment can have its own seasonal pattern (e.g., Genre Packs sports cohorts may have different seasonality than Signature).
-
Reconnects and migrations modules: Add explicit submodels for customers who churn and return (reconnects, typically 10 to 20 percent of churners over 12 months) and customers who move between products (migrations, e.g., Signature to BYOD as customers shift to streaming-first plans). Both are critical for accurate net subscriber accounting.
-
Forecast accuracy monitoring: Automated weekly retraining with rolling MAPE tracking. Alerting on accuracy drift triggers manual review.
-
Scenario calibration framework: Replace illustrative multipliers with empirically-calibrated scenario impacts based on historical analogs. For pricing actions specifically, link to a separate elasticity model.
-
Production pipeline: Databricks orchestration, Snowflake as the data warehouse, scheduled retraining (weekly), automated dashboard refresh, MAPE monitoring with alerting, version-controlled assumption documentation in a model registry.
-
Executive scenario UI: A self-service interface where Marketing and Finance can run their own scenarios without analyst intervention.
pip install -r requirements.txtpython streamvista_cohort_forecasting.pyThe script will:
- Generate synthetic cohort observations across 3 segments and 13 quarterly cohorts
- Fit Weibull (and exponential, for comparison) survival models per segment
- Backtest the cohort and survival model on held-out cohorts
- Build the historical gross adds time series and fit SARIMA(1,1,1)(1,1,1,4)
- Forecast forward gross adds with seasonality
- Compose the integrated forecast: SARIMA gross adds + Weibull survival + cohort stacking
- Run scenario overlays (pricing shock, promo intensity, competitive entry)
- Build the naive run-rate baseline for comparison
- Generate the nine-panel dashboard PNG
- Print the executive summary
Total runtime: around 10 to 15 seconds.
streamvista-cohort-forecasting/
|
|-- streamvista_cohort_forecasting.py # Full integrated pipeline
|-- streamvista_cohort_dashboard.png # Nine-panel analytical dashboard
|-- 01_synthetic_cohort_data.csv # Simulated cohort data (3 segments x 13 cohorts)
|-- requirements.txt # Python dependencies
|-- .gitignore # Excludes __pycache__, .pyc, .DS_Store
|-- LICENSE # MIT license
`-- README.md # This document
| Library | Version | Purpose |
|---|---|---|
numpy |
>= 1.24 | Numerical computation |
pandas |
>= 2.0 | Tabular data management |
matplotlib |
>= 3.7 | Dashboard visualization |
scipy |
>= 1.10 | Nonlinear least squares fitting |
statsmodels |
>= 0.14 | SARIMA fitting (statsmodels.tsa.statespace.sarimax.SARIMAX) |
MIT. Free to use, adapt, and build on.
All data is synthetically simulated. The modeling pipeline, methodology, and production roadmap reflect current industry practices in subscriber forecasting and survival analysis for subscription businesses at scale.