Rotation thresholds fitted to DR's own lists (P3 23, P4 ~14, P6 16 plays/week: ~3x the old guess); IFPI 2010-2026 walk-forward test bed and route/lead-lag analysis; site and docs updated

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-15 02:54:59 +00:00
co-authored by Claude Opus 5.5
parent c698925814
commit bbfb437011
10 changed files with 557 additions and 5 deletions
+124
View File
@@ -0,0 +1,124 @@
//! Rotation thresholds from the real lists. For every parsed rotation list whose week lies in
//! the DR panel, compare the artists on the list (per channel; the national P4 list against each
//! regional P4) with the artists' plays that week. Reports plays by category and the threshold
//! that best separates listed from not-listed artists, and stores the thresholds in
//! `rotation_thresholds`, which the models then use instead of the play-distribution guess.
use super::panel::{key, Panel, C, CHANNELS};
use crate::db::Db;
use anyhow::Result;
use chrono::{Duration, NaiveDate};
use std::collections::{HashMap, HashSet};
use std::fmt::Write as _;
pub fn create_tables(db: &Db) -> Result<()> {
db.conn.execute_batch(
"CREATE TABLE IF NOT EXISTS rotation_thresholds (
channel TEXT PRIMARY KEY, tau INTEGER NOT NULL, f1 REAL, listed INTEGER, weeks INTEGER, made_at TEXT NOT NULL
);",
)?;
Ok(())
}
/// Thresholds stored by `run`, if any.
pub fn stored(db: &Db) -> Result<Option<[u32; C]>> {
create_tables(db)?;
let mut tau = [0u32; C];
let mut n = 0;
for r in db.conn.prepare("SELECT channel, tau FROM rotation_thresholds")?.query_map([], |r| Ok((r.get::<_, String>(0)?, r.get::<_, i64>(1)?)))? {
let (ch, t) = r?;
if let Some(c) = CHANNELS.iter().position(|x| *x == ch) { tau[c] = t as u32; n += 1; }
}
Ok(if n == C { Some(tau) } else { None })
}
/// The artists credited in a list line ("A [+] B", "A feat. B", "A & B", "A, B").
fn names(s: &str) -> Vec<String> {
let mut parts = vec![s.to_lowercase()];
for sep in [" [+] ", " feat. ", " feat ", " ft. ", " ft ", " featuring ", " & ", ", ", " x ", " og ", " med ", " vs. ", " vs "] {
parts = parts.iter().flat_map(|p| p.split(sep).map(str::to_string).collect::<Vec<_>>()).collect();
}
let mut out = vec![key(s)];
out.extend(parts.iter().map(|p| key(p)));
out.retain(|k| !k.is_empty());
out
}
pub fn run(db: &Db, p: &Panel) -> Result<String> {
create_tables(db)?;
let mut by_key: HashMap<String, Vec<usize>> = HashMap::new();
for (i, a) in p.artists.iter().enumerate() { by_key.entry(key(&a.name)).or_default().push(i); }
let week_of: HashMap<NaiveDate, usize> = p.weeks.iter().enumerate().map(|(i, d)| (*d, i)).collect();
// (list channel, week index) -> artist -> best category
let mut listed: HashMap<(String, usize), HashMap<usize, String>> = HashMap::new();
let mut unmatched = 0usize;
let mut total = 0usize;
let rank = |c: &str| match c { "A" => 0, "B" => 1, "C" => 2, _ => 3 };
for r in db.conn.prepare("SELECT list_date, channel, category, artist FROM rotation_lists")?
.query_map([], |r| Ok((r.get::<_, String>(0)?, r.get::<_, String>(1)?, r.get::<_, String>(2)?, r.get::<_, String>(3)?)))? {
let (date, ch, cat, artist) = r?;
let Ok(d) = NaiveDate::parse_from_str(&date, "%Y-%m-%d") else { continue };
// A Friday list applies to the week starting the following Monday.
let Some(&w) = week_of.get(&(d + Duration::days(3))) else { continue };
total += 1;
let ids: HashSet<usize> = names(&artist).iter().filter_map(|k| by_key.get(k)).flatten().copied().collect();
if ids.is_empty() { unmatched += 1; continue; }
let m = listed.entry((ch, w)).or_default();
for a in ids {
let e = m.entry(a).or_insert_with(|| cat.clone());
if rank(&cat) < rank(e) { *e = cat.clone(); }
}
}
let mut md = String::new();
writeln!(md, "# Rotation thresholds from DR's lists\n")?;
let weeks: HashSet<usize> = listed.keys().map(|k| k.1).collect();
let mut wl: Vec<String> = weeks.iter().map(|w| p.weeks[*w].to_string()).collect();
wl.sort();
writeln!(md, "Lists inside the DR panel: weeks starting {}. List lines in those weeks: {total}; artist not among the DR artists read: {unmatched}.\n", wl.join(", "))?;
writeln!(md, "| Channel | τ (best F1) | F1 | Listed artist-weeks | Median plays A | B | C | Median plays, not listed but played | Old τ |\n|---|---|---|---|---|---|---|---|---|")?;
let old = super::common::thresholds_from_plays(p, p.w());
let made = chrono::Utc::now().to_rfc3339();
let mut out_tau = [0u32; C];
for c in 0..C {
let list_ch = if CHANNELS[c].starts_with("p4") { "p4" } else { CHANNELS[c] };
let mut by_cat: HashMap<String, Vec<f64>> = HashMap::new();
let mut not_listed: Vec<f64> = Vec::new();
let mut pairs: Vec<(f64, bool)> = Vec::new();
let mut n_weeks = 0;
for &w in &weeks {
let Some(m) = listed.get(&(list_ch.to_string(), w)) else { continue };
n_weeks += 1;
for a in 0..p.a() {
let y = p.y(a, c, w);
match m.get(&a) {
Some(cat) => { by_cat.entry(cat.clone()).or_default().push(y); pairs.push((y, true)); }
None => { if y > 0.0 { not_listed.push(y); } pairs.push((y, false)); }
}
}
}
if n_weeks == 0 { out_tau[c] = old[c]; continue; }
let med = |v: Option<&Vec<f64>>| v.filter(|v| !v.is_empty()).map(|v| { let mut v = v.clone(); v.sort_by(f64::total_cmp); v[v.len() / 2] }).map(|m| format!("{m:.0}")).unwrap_or("—".into());
// Best threshold by F1 of "plays >= tau" against "on the list".
let (mut best, mut best_f1) = (old[c], 0.0);
for tau in 1..=40u32 {
let (mut tp, mut fp, mut fn_) = (0.0, 0.0, 0.0);
for (y, l) in &pairs {
let pred = *y >= tau as f64;
match (pred, *l) { (true, true) => tp += 1.0, (true, false) => fp += 1.0, (false, true) => fn_ += 1.0, _ => {} }
}
let f1 = if tp > 0.0 { 2.0 * tp / (2.0 * tp + fp + fn_) } else { 0.0 };
if f1 > best_f1 { best_f1 = f1; best = tau; }
}
out_tau[c] = best;
let n_listed = pairs.iter().filter(|x| x.1).count();
let mut nl = not_listed.clone();
nl.sort_by(f64::total_cmp);
writeln!(md, "| {} | {best} | {best_f1:.2} | {n_listed} | {} | {} | {} | {} | {} |", CHANNELS[c], med(by_cat.get("A")), med(by_cat.get("B")), med(by_cat.get("C")),
med(Some(&nl)), old[c])?;
db.conn.execute("INSERT OR REPLACE INTO rotation_thresholds VALUES (?1, ?2, ?3, ?4, ?5, ?6)",
rusqlite::params![CHANNELS[c], best as i64, best_f1, n_listed as i64, n_weeks as i64, made])?;
}
writeln!(md, "\nThe models now read these thresholds (table `rotation_thresholds`). Listed artist-weeks count an artist once per week even with several songs listed; plays are the artist's total that week, including off-list plays.\n")?;
Ok(md)
}
+9 -3
View File
@@ -5,10 +5,16 @@ use super::features::{self, LAGS, P};
use super::glm::{self, Design};
use super::panel::{Panel, C};
/// "In rotation" on channel c = at least tau[c] plays in the week. Set from each channel's
/// distribution of non-zero artist-weeks (75th percentile, at least 3) over weeks < `upto`;
/// to be calibrated on the Friday rotation lists once they're parsed.
/// "In rotation" on channel c = at least tau[c] plays in the week: the thresholds fitted to DR's
/// rotation lists if `airplay model calibrate` has run, else each channel's 75th percentile of
/// non-zero artist-weeks (at least 3) over weeks < `upto`.
pub fn thresholds(p: &Panel, upto: usize) -> [u32; C] {
// Calibrated on DR's own rotation lists when available (`airplay model calibrate`).
if let Some(t) = p.list_tau { return t; }
thresholds_from_plays(p, upto)
}
pub fn thresholds_from_plays(p: &Panel, upto: usize) -> [u32; C] {
let mut tau = [3u32; C];
for (c, t) in tau.iter_mut().enumerate() {
let mut v: Vec<f64> = (0..p.a()).flat_map(|a| (0..upto).map(move |w| (a, w))).map(|(a, w)| p.y(a, c, w)).filter(|&y| y > 0.0).collect();
+175
View File
@@ -0,0 +1,175 @@
//! The IFPI test bed (doc: "Two backtest beds"): 20 years of national, song-level charts.
//!
//! Track Top-40 (sales + streaming, streaming counted from Nov 2014) since 2007
//! Airplay Top-20 (most played on the big Danish stations) since 2001-W38
//!
//! 1. Routes and lead–lag: for songs on both charts, which came first and by how many weeks,
//! per chart period.
//! 2. A walk-forward test: when a song enters the Track Top-40 without having been on the
//! Airplay Top-20, does it reach the Airplay Top-20 within 8 weeks? Fitted on years before
//! Y, scored on year Y, for Y = 2010..now, against a base rate and an entry-position-only model.
//!
//! airplay model ifpi -> docs/IFPI.md
use super::glm::{self, Design};
use super::panel::key;
use crate::db::Db;
use anyhow::Result;
use chrono::{Datelike, NaiveDate, Weekday};
use std::collections::{BTreeMap, HashMap};
use std::fmt::Write as _;
const WINDOW: i64 = 8;
#[derive(Clone)]
struct Row { chart_t40: bool, monday: NaiveDate, pos: i64, song: String, primary: String }
/// The song's key: primary artist + title without version tags.
fn song_key(artist: &str, title: &str) -> (String, String) {
let lower = artist.to_lowercase();
let mut cut = lower.len();
for sep in [" feat.", " feat ", " ft.", " ft ", " featuring ", " & ", ", ", " x ", " og ", " med ", " vs", " / ", " + "] {
if let Some(i) = lower.find(sep) { cut = cut.min(i); }
}
let primary = key(&lower[..cut]);
let t = title.split(" (").next().unwrap_or(title).split(" - ").next().unwrap_or(title);
(primary.clone(), format!("{primary}|{}", key(t)))
}
fn period(d: NaiveDate) -> &'static str {
if d < NaiveDate::from_ymd_opt(2007, 11, 1).unwrap() { "2007 (sales only)" }
else if d < NaiveDate::from_ymd_opt(2014, 11, 1).unwrap() { "Nov 2007–Oct 2014 (sales + downloads)" }
else { "Nov 2014– (streaming counted)" }
}
struct Song { first_t40: Option<(NaiveDate, i64)>, first_air: Option<NaiveDate>, primary: String }
pub fn run(db: &Db) -> Result<String> {
let mut rows = Vec::new();
for r in db.conn.prepare("SELECT chart, year, week, position, artist, title FROM hitlisten_charts WHERE chart IN ('t40', 'airplay')")?
.query_map([], |r| Ok((r.get::<_, String>(0)?, r.get::<_, i32>(1)?, r.get::<_, u32>(2)?, r.get::<_, i64>(3)?, r.get::<_, String>(4)?, r.get::<_, String>(5)?)))? {
let (chart, y, w, pos, artist, title) = r?;
let Some(monday) = NaiveDate::from_isoywd_opt(y, w, Weekday::Mon) else { continue };
let (primary, song) = song_key(&artist, &title);
rows.push(Row { chart_t40: chart == "t40", monday, pos, song, primary });
}
rows.sort_by_key(|r| r.monday);
let t40_start = rows.iter().filter(|r| r.chart_t40).map(|r| r.monday).min().unwrap_or_default();
let last_week = rows.iter().map(|r| r.monday).max().unwrap_or_default();
let mut songs: HashMap<String, Song> = HashMap::new();
for r in &rows {
let s = songs.entry(r.song.clone()).or_insert(Song { first_t40: None, first_air: None, primary: r.primary.clone() });
if r.chart_t40 { if s.first_t40.is_none() { s.first_t40 = Some((r.monday, r.pos)); } }
else if s.first_air.is_none() { s.first_air = Some(r.monday); }
}
let mut md = String::new();
writeln!(md, "# IFPI test bed\n")?;
writeln!(md, "Track Top-40 from {t40_start}, Airplay Top-20 since 2001; latest chart week {last_week}. Songs matched across the charts by primary artist + title without version tags.\n")?;
// ---- 1. routes and lead–lag
writeln!(md, "## Routes: which chart a song reached first\n")?;
writeln!(md, "Songs on both charts whose first appearance on either was after the Track Top-40 began. Lag = first Airplay Top-20 week − first Track Top-40 week.\n")?;
writeln!(md, "| Period (of the first appearance) | Songs on both | Charts first (lag ≥ 2) | Same time (±1 week) | Radio first (lag ≤ −2) | Median lag, charts first | Median lag, radio first |\n|---|---|---|---|---|---|---|")?;
let mut by_period: BTreeMap<&str, Vec<i64>> = BTreeMap::new();
let mut only_air: BTreeMap<&str, usize> = BTreeMap::new();
for s in songs.values() {
match (s.first_t40, s.first_air) {
(Some((t, _)), Some(a)) if t.min(a) > t40_start + chrono::Duration::weeks(4) => {
by_period.entry(period(t.min(a))).or_default().push((a - t).num_weeks());
}
(None, Some(a)) if a > t40_start + chrono::Duration::weeks(4) => *only_air.entry(period(a)).or_insert(0) += 1,
_ => {}
}
}
let median = |mut v: Vec<i64>| -> String { if v.is_empty() { return "—".into(); } v.sort(); format!("{}", v[v.len() / 2]) };
for (p, lags) in &by_period {
let n = lags.len() as f64;
let cf: Vec<i64> = lags.iter().copied().filter(|l| *l >= 2).collect();
let rf: Vec<i64> = lags.iter().copied().filter(|l| *l <= -2).map(|l| -l).collect();
let same = lags.iter().filter(|l| l.abs() <= 1).count() as f64;
writeln!(md, "| {p} | {} | {:.0}% | {:.0}% | {:.0}% | {} wk | {} wk |", lags.len(), 100.0 * cf.len() as f64 / n, 100.0 * same / n, 100.0 * rf.len() as f64 / n, median(cf), median(rf))?;
}
writeln!(md, "\nAirplay Top-20 songs never on the Track Top-40 (radio only): {}.\n",
only_air.iter().map(|(p, n)| format!("{p}: {n}")).collect::<Vec<_>>().join("; "))?;
// ---- 2. walk-forward: Track Top-40 entry -> Airplay Top-20 within 8 weeks
// Artist history as of a date: earlier Airplay Top-20 songs and Track Top-40 songs.
let mut air_songs_by_artist: HashMap<String, Vec<NaiveDate>> = HashMap::new();
let mut t40_songs_by_artist: HashMap<String, Vec<(NaiveDate, bool)>> = HashMap::new(); // entry date, reached airplay
for s in songs.values() {
if let Some(a) = s.first_air { air_songs_by_artist.entry(s.primary.clone()).or_default().push(a); }
if let Some((t, _)) = s.first_t40 {
let reached = s.first_air.is_some_and(|a| a >= t && (a - t).num_weeks() <= WINDOW);
t40_songs_by_artist.entry(s.primary.clone()).or_default().push((t, reached));
}
}
struct Ex { date: NaiveDate, x: Vec<f64>, y: bool }
let mut ex: Vec<Ex> = Vec::new();
for s in songs.values() {
let Some((t, pos)) = s.first_t40 else { continue };
if t <= t40_start + chrono::Duration::weeks(4) { continue; } // already charting when the chart began
if t + chrono::Duration::weeks(WINDOW) > last_week { continue; } // window not closed
if s.first_air.is_some_and(|a| a < t) { continue; } // radio got there first: not a candidate
let y = s.first_air.is_some_and(|a| (a - t).num_weeks() <= WINDOW);
let prior_air = air_songs_by_artist.get(&s.primary).map(|v| v.iter().filter(|d| **d < t).count()).unwrap_or(0) as f64;
let prior: Vec<&(NaiveDate, bool)> = t40_songs_by_artist.get(&s.primary).map(|v| v.iter().filter(|(d, _)| *d + chrono::Duration::weeks(WINDOW) <= t).collect()).unwrap_or_default();
let prior_t40 = prior.len() as f64;
// the artist's earlier conversion rate (shrunk towards the overall ~ rate)
let conv = (prior.iter().filter(|p| p.1).count() as f64 + 0.3) / (prior_t40 + 1.0);
let recent_air = air_songs_by_artist.get(&s.primary).map(|v| v.iter().filter(|d| **d < t && (t - **d).num_weeks() <= 52).count()).unwrap_or(0) as f64;
let wk = t.iso_week().week();
let streaming = (t >= NaiveDate::from_ymd_opt(2014, 11, 1).unwrap()) as i32 as f64;
let x = vec![1.0, (41.0 - pos as f64) / 40.0, ((41.0 - pos as f64) / 40.0).powi(2), prior_air.ln_1p(), prior_t40.ln_1p(), conv,
recent_air.ln_1p(), (wk >= 46) as i32 as f64, streaming, streaming * (41.0 - pos as f64) / 40.0];
ex.push(Ex { date: t, x, y });
}
ex.sort_by_key(|e| e.date);
let names = ["intercept", "entry position score", "entry score²", "log earlier Airplay Top-20 songs", "log earlier Track Top-40 songs",
"artist's earlier conversion rate", "log Airplay Top-20 songs in the last year", "entered in weeks 46–52", "streaming era", "streaming × entry score"];
let ll = |p: f64, y: bool| -(if y { p } else { 1.0 - p }).clamp(1e-9, 1.0).ln();
writeln!(md, "## Walk-forward: does a Track Top-40 entry reach the Airplay Top-20 within {WINDOW} weeks?\n")?;
writeln!(md, "Candidates: songs entering the Track Top-40 that hadn't been on the Airplay Top-20. Each year is scored with models fitted on the years before it.\n")?;
writeln!(md, "| Year | Entries | Reached airplay | Log-loss base rate | Log-loss entry position | Log-loss full | Skill full vs base | Skill full vs position |\n|---|---|---|---|---|---|---|---|")?;
let first_year = ex.first().map(|e| e.date.year()).unwrap_or(2010).max(2010);
let last_year = ex.last().map(|e| e.date.year()).unwrap_or(2026);
let (mut tot_b, mut tot_p, mut tot_f) = (0.0, 0.0, 0.0);
let mut pairs: [Vec<(f64, bool)>; 3] = Default::default();
for year in first_year..=last_year {
let train: Vec<&Ex> = ex.iter().filter(|e| e.date.year() < year && e.date + chrono::Duration::weeks(WINDOW) < NaiveDate::from_ymd_opt(year, 1, 1).unwrap()).collect();
let test: Vec<&Ex> = ex.iter().filter(|e| e.date.year() == year).collect();
if train.len() < 200 || test.is_empty() { continue; }
let rate = (train.iter().filter(|e| e.y).count() as f64 + 1.0) / (train.len() as f64 + 2.0);
let fit = |cols: &[usize]| {
let mut d = Design::new(cols.len());
for e in &train { let x: Vec<f64> = cols.iter().map(|&c| e.x[c]).collect(); d.push(&x, e.y as i32 as f64, 1.0); }
glm::logit(&d, 1.0)
};
let pos_cols = [0usize, 1, 2];
let all: Vec<usize> = (0..names.len()).collect();
let (bp, bf) = (fit(&pos_cols), fit(&all));
let pr = |b: &[f64], cols: &[usize], e: &Ex| glm::sigmoid(cols.iter().zip(b).map(|(&c, w)| e.x[c] * w).sum::<f64>());
let (mut lb, mut lp, mut lf) = (0.0, 0.0, 0.0);
for e in &test {
let (p0, p1, p2) = (rate, pr(&bp, &pos_cols, e), pr(&bf, &all, e));
lb += ll(p0, e.y); lp += ll(p1, e.y); lf += ll(p2, e.y);
pairs[0].push((p0, e.y)); pairs[1].push((p1, e.y)); pairs[2].push((p2, e.y));
}
tot_b += lb; tot_p += lp; tot_f += lf;
let n = test.len() as f64;
writeln!(md, "| {year} | {} | {:.0}% | {:.3} | {:.3} | {:.3} | {:+.3} | {:+.3} |", test.len(), 100.0 * test.iter().filter(|e| e.y).count() as f64 / n,
lb / n, lp / n, lf / n, 1.0 - lf / lb, 1.0 - lf / lp)?;
}
let ap = |mut v: Vec<(f64, bool)>| { v.sort_by(|a, b| b.0.total_cmp(&a.0)); let (mut h, mut s) = (0.0, 0.0); for (i, (_, y)) in v.iter().enumerate() { if *y { h += 1.0; s += h / (i as f64 + 1.0); } } if h > 0.0 { s / h } else { f64::NAN } };
writeln!(md, "\nAll years: skill of the full model {:+.3} vs base rate, {:+.3} vs entry position only. PR-AUC: base {:.3}, position {:.3}, full {:.3}.\n",
1.0 - tot_f / tot_b, 1.0 - tot_f / tot_p, ap(pairs[0].clone()), ap(pairs[1].clone()), ap(pairs[2].clone()))?;
// Coefficients on everything.
let mut d = Design::new(names.len());
for e in &ex { d.push(&e.x, e.y as i32 as f64, 1.0); }
let b = glm::logit(&d, 1.0);
writeln!(md, "| Feature (all years) | Coefficient |\n|---|---|")?;
for (n, w) in names.iter().zip(&b) { writeln!(md, "| {n} | {w:+.3} |")?; }
writeln!(md)?;
Ok(md)
}
+14
View File
@@ -3,14 +3,18 @@
//!
//! airplay model panel what the panel holds
//! airplay model backtest [--h 1,4,8] [--refit 1] [--out docs/BACKTEST.md]
//! airplay model calibrate rotation thresholds from DR's lists -> docs/CALIBRATION.md
//! airplay model ifpi the 20-year IFPI test bed -> docs/IFPI.md
//! airplay model adds [--h 0,4] [--out docs/BACKTEST-ADDS.md] backtest of the new-add model
//! airplay model rank [--h 4] [--max-h 12] [--top 50]
pub mod adds;
pub mod backtest;
pub mod calibrate;
pub mod common;
pub mod features;
pub mod glm;
pub mod ifpi;
pub mod kalman;
pub mod panel;
pub mod rank;
@@ -53,6 +57,16 @@ pub fn run(db: &Db, args: &[String]) -> Result<()> {
print!("{}", report.markdown);
eprintln!("written to {out}");
}
Some("ifpi") => {
let md = ifpi::run(db)?;
std::fs::write("docs/IFPI.md", &md)?;
print!("{md}");
}
Some("calibrate") => {
let md = calibrate::run(db, &p)?;
std::fs::write("docs/CALIBRATION.md", &md)?;
print!("{md}");
}
Some("adds") => {
let horizons: Vec<usize> = arg(args, "--h").unwrap_or_else(|| "0,4".into()).split(',').filter_map(|s| s.trim().parse().ok()).collect();
let tau = common::thresholds(&p, 26);
+4 -1
View File
@@ -49,6 +49,8 @@ pub struct Panel {
pub artists: Vec<Artist>,
y: Vec<f32>,
chart: Vec<Chart>,
/// Rotation thresholds fitted to DR's rotation lists, if calibrated.
pub list_tau: Option<[u32; C]>,
}
impl Panel {
@@ -111,7 +113,8 @@ impl Panel {
}
let chart = chart_states(db, &weeks, &names, artists.len())?;
Ok(Panel { weeks, artists, y, chart })
let list_tau = super::calibrate::stored(db)?;
Ok(Panel { weeks, artists, y, chart, list_tau })
}
}
+4 -1
View File
@@ -153,11 +153,14 @@ svg text { fill: var(--muted); font-size: 11px; }
<p class="note prose">Walk-forward: for each week from week 27, the models are fitted only on what was known at the time and forecast 1, 4 and 8 weeks ahead. "Adds" are rows where the artist was not in rotation at the time of the forecast, which is the hard and interesting part. Skill above 0 means better than the baseline.</p>
<div class="cards" id="cards"></div>
<div class="prose">
<h2>20 years of IFPI charts</h2>
<p>A second test, on the national charts: when a song enters the Track Top-40 without having been on the Airplay Top-20, does it reach the Airplay Top-20 within 8 weeks? Scored year by year from 2010, each year with a model fitted on the years before it. It beats the base rate by +0.13 in log-loss skill (PR-AUC 0.41 vs 0.20), and the strongest signal is the artist's own radio history: earlier Airplay Top-20 songs and how often their earlier hits crossed over.</p>
<p>Since streaming started counting (Nov 2014), 55% of songs on both charts hit the Track Top-40 first (median 5 weeks before airplay), 29% move together and 17% are radio first. Another 837 songs reached the Airplay Top-20 without ever charting on the Track Top-40.</p>
<h2>Known limits</h2>
<ul>
<li><b>The artist pool is selected.</b> It holds only artists DR played in mid-November 2026, so every artist had airplay at the end of the window. Scores for the last weeks are flattered.</li>
<li><b>Not yet "if they release a song on date X".</b> The ranking is expected airplay given current form and chart situation. Conditioning on a release needs release dates (being collected).</li>
<li><b>Rotation thresholds are estimates</b> until DR's weekly rotation lists are parsed.</li>
<li><b>Rotation thresholds</b> are fitted to six of DR's weekly rotation lists inside the 51-week window ("plays ≥ threshold" matches the real lists with F1 ≈ 0.74 on P3/P4, 0.78 on P6, about 0.5 on P5/P8, which play more off-list).</li>
<li><b>Christmas</b> is only seen once, as history. Forecasts for weeks 48–52 don't know about Christmas songs yet.</li>
</ul>
</div>