85 lines
6.8 KiB
Markdown
85 lines
6.8 KiB
Markdown
# Models: predicting when an artist gets played again
|
||
|
||
## How airplay actually happens
|
||
|
||
The models should follow how stations really decide what to play:
|
||
|
||
1. **The playlist decides how often.** Each station has a playlist, split into rotation categories. DR publishes them weekly as A / B / C; roughly, A = several plays a day and C = a few a week. Songs are added and dropped weekly.
|
||
- DR adds mostly new releases.
|
||
- NOVA often adds a song only once it reaches the Spotify Top 50.
|
||
2. **The scheduler decides when.** Music-scheduling software places songs into clock slots under separation rules: a minimum gap before the same song or artist repeats, plus dayparting (which hours a song may play).
|
||
3. **The rest is outside the lists:** specialist shows, guest DJs, recurrent/gold songs, live sessions. Bauer's exact play logs capture these too.
|
||
|
||
So the question splits into three:
|
||
|
||
| Question | Time scale | Data |
|
||
|---|---|---|
|
||
| Will the song be added to the playlist, and at which station first? | weeks | rotation PDFs, plays across stations |
|
||
| While on the list, how often, and when in the day? | hours–days | exact plays |
|
||
| When does it drop out (and does it come back as a recurrent)? | weeks–months | plays, DR artist weekly history |
|
||
|
||
## Methods borrowed from finance and insurance
|
||
|
||
| Method | Comes from | Used here for |
|
||
|---|---|---|
|
||
| **Hazard / survival models** (Cox proportional hazards, Weibull, competing risks) | company bankruptcy, credit default, life insurance | how long a song stays in rotation; when it gets dropped (the "default"); being added (the competing event is "never added"). Covariates: station, category, artist history, release age, Spotify chart position. |
|
||
| **Hawkes processes** (self-exciting point processes) | trade arrivals, default contagion, earthquake aftershocks | play times: each play raises the short-term rate, and the decay shows the rotation. A multivariate Hawkes model across stations measures spillover: does a P3 play make a P4 or NOVA play more likely? |
|
||
| **Inhomogeneous Poisson / renewal processes** with a minimum gap | insurance claims arrivals | inter-play times within a category: a dead time (the separation rule) plus a time-of-day / day-of-week baseline. |
|
||
| **Regime switching** (hidden Markov models) | currency regimes, bull/bear markets | a song's lifecycle: not on list → new → A rotation → B/C → recurrent → gone. The weekly rotation lists label the states (for DR) and train the model, which can then infer them for Bauer, where nothing is published. |
|
||
| **Claims-frequency GLMs** (Poisson / negative binomial) | car insurance pricing | weekly play counts per song and station, with the overdispersion real data has. |
|
||
| **Credibility theory** (Bühlmann / empirical Bayes) | insurance premiums for small portfolios | new or small artists have little history; shrink their estimates towards the station or genre average. |
|
||
| **Bass diffusion / lead-lag** (Granger) | product adoption, cross-market lead-lag | how a song spreads from one station to the others, and which stations lead. |
|
||
| **State-space / Kalman filter** | volatility, nowcasting | a smooth "airplay momentum" per artist from noisy daily counts. |
|
||
|
||
## Evaluating predictions
|
||
|
||
The same way trading models are tested:
|
||
- **Walk-forward backtests:** fit on the past, predict the next day or week, roll forward. Never fit on the future.
|
||
- **Scores:** log-likelihood of the observed next-play time (probabilistic forecasts, not single numbers), and calibration ("events predicted at 30% happen 30% of the time").
|
||
- **Baselines to beat:** "same as last week", and a per-song average rate. A model that can't beat these isn't worth having.
|
||
|
||
## Order of work
|
||
|
||
1. **Collect** (done: daily) and **clean**: artist name normalisation across DR and Bauer, featured artists, track ids across stations.
|
||
2. **Describe:**
|
||
- inter-play distributions per category (they should show the separation gap);
|
||
- hour-of-day profiles;
|
||
- list lifetimes from DR's 52-week artist histories.
|
||
3. **Baselines**, then **survival models** for list lifetime, and **Hawkes / renewal models** for play times.
|
||
4. **Cross-station** models once there are a few months of data.
|
||
|
||
## What is built (src/model)
|
||
|
||
The first layer follows the design doc's "model we can build now": an **artist × DR channel × week** panel from the DR artist pages (52 Monday–Sunday weeks; the week still running when the pages were read is left out), joined to IFPI chart history by artist name. A chart week counts as known one week after it ends.
|
||
|
||
```
|
||
airplay model panel what the panel holds, rotation thresholds
|
||
airplay model backtest [--h 1,4,8] [--refit 1] walk-forward backtest -> docs/BACKTEST.md, backtest_scores
|
||
airplay model rank [--h 4] [--max-h 12] [--top 50] the ranking for h = 1..12 -> forecasts
|
||
```
|
||
|
||
- **"In rotation"** = at least τ_c plays in the week. τ_c is the 75th percentile of each channel's non-zero artist-weeks, and at least 3. It is to be recalibrated on the parsed Friday lists.
|
||
- **Features** use only what was known at the end of the origin week:
|
||
- lagged plays on the channel and on the other channels, and weeks since last played;
|
||
- Track Top-40 and Airplay Top-20 status, recency of the latest chart entry, career chart hits;
|
||
- from the artist page: Danish, group, gender, career years;
|
||
- Christmas, Danish × channel, and channel dummies.
|
||
- **Models**, each fitted directly for each horizon h:
|
||
- negative binomial for weekly plays (dispersion by maximum likelihood);
|
||
- logistic regression for "in rotation";
|
||
- a local-level Kalman filter on log plays (the "artist form" first version);
|
||
- the doc's persistence and popularity baselines.
|
||
- **Backtest:** origins from week 26, refitted weekly. It scores:
|
||
- log-loss and Brier score on all rows and on adds (rows not in rotation at the origin);
|
||
- PR-AUC on adds and MAE on plays;
|
||
- Spearman and NDCG@50 of the artist ranking;
|
||
- skill against the baselines, with 90% block-bootstrap intervals;
|
||
- calibration by decile.
|
||
- **Ranking:** NB means per channel, simulated with one gamma draw per artist shared by all channels. It gives P(rotation) per channel, P(any channel), and total plays with an 80% interval.
|
||
|
||
**Known limits:**
|
||
- **The artist pool is selected.** Only artists heard on DR in the week the pages were read are in it, so every artist was played at the end of the window, and add rates late in the window are inflated. Widening the pool fixes this: artists from IFPI charts, Bauer logs, featured artists and older plays.
|
||
- **Not conditioned on a release yet.** The ranking is expected airplay given current form. The release-effect event study needs release dates (Deezer backfill).
|
||
- **"Release timing only" is not scored yet.** That baseline needs release dates too.
|
||
- **Christmas is barely seen.** It appears only as lag history (weeks 48–52 of 2025), never as a target week.
|