drag to zoom · double-click to reset · scores follow the view
Scores against climatology
Climatology is the slot climatology of the last 28 days, built from the same run's inputs. Ratio = our score ÷ climatology on the days both have; below 1 beats it. Coverage target is 80%. Lower is better for every other metric.
Predico's official scores
How Predico scored our submissions and where we ranked among all forecasters on that challenge. Only our own results are shown.
Submission record
One square per target day (${m.city}). Click a day to show it in the chart.
Latest run ${esc(T.last_run.slice(0, 16).replace("T", " "))} UTC · ${T.runs} run${T.runs === 1 ? "" : "s"} published
${esc(T.env)}
${esc(T.model)}: t0-gamma (The Forecasting Company, Apache-2.0), zero-shot, 90 days of context, with covariates. D+2 to D+10 fall back to slot climatology. Backtest results
${(T.features.length ? T.features : ["(feature list arrives with the first published run)"]).map(f => `${esc(f)}`).join("")}
Daily scores
Every target day, newest first. Click a row to show it in the chart.
`;
}
summary(main.inst.scales.x.min, main.inst.scales.x.max);
// Official scores: one column per variable and metric, value with our rank among N.
const off = T.official ?? [], offEl = root.querySelector("#lv-off");
if (!off.length) offEl.innerHTML = `
No official scores yet. Predico scores a day once its measurements are in, usually a day or two after delivery.
`;
else {
const cols = [...new Set(off.map(r => `${r.variable} ${r.metric}`))].sort();
const byDay = new Map();
for (const r of off) (byDay.get(r.day) ?? byDay.set(r.day, {}).get(r.day))[`${r.variable} ${r.metric}`] = r;
const days = [...byDay.keys()].sort().reverse();
const rankCell = r => (r ? `
`;
}
// Daily table, newest first; days without measurements still show their status.
const scoredDay = new Map(model.map(d => [d.key, d]));
const cell = (d, b, m, f) => {
const v = d?.[m], c = b?.[m], r = m === "coverage" || v == null || c == null ? null : v / c;
return `
${r.state === "miss" ? "no forecast" : "awaiting measurements"}
`}
`;
}).join("")}
`;
root.querySelector("#lv-daily").addEventListener("click", e => { const tr = e.target.closest("tr[data-k]"); if (tr) zoomDay(tr.dataset.k); });
}
}
// --- Backtest ----------------------------------------------------------------------------
function leaderboard(days, baseline) {
const rows = {};
for (const [t, d] of Object.entries(days)) {
for (const [c, s] of Object.entries(d.configs)) {
const r = (rows[c] ??= { config: c });
for (const m of ["rmse", "winkler"]) {
const a = s[m], b = d.configs[baseline][m];
let sa = 0, sb = 0, nb = 0;
for (let i = 0; i < a.length; i++) if (a[i] != null && b[i] != null) { sa += a[i]; sb += b[i]; nb++; }
r[`${t} ${m}`] = mean(a);
r[`${t} ${m} rel`] = nb ? sa / sb : null;
}
r[`${t} coverage`] = mean(s.coverage);
r[`${t} days`] = s.rmse.filter(v => v != null).length;
}
}
const out = Object.values(rows);
for (const r of out) {
const rel = Object.keys(r).filter(k => k.endsWith(" rel")).map(k => r[k]);
r.score = rel.every(v => v) ? Math.exp(mean(rel.map(Math.log))) : null;
}
out.sort((a, b) => (a.score ?? 9) - (b.score ?? 9));
out.forEach((r, i) => (r.rank = r.score == null ? null : i + 1));
return out;
}
async function renderBacktest(root) {
const [allDays, meta, prof, wxAll] = await Promise.all([json("days.json"), json("meta.json"), json("profiles.json"), json("weather.json").catch(() => ({}))]);
const m = mk(), wx = (wxAll[m.id]?.models ?? []).map(r => r.name), targets = shortsOf(m, meta).filter(t => allDays[t]);
if (!targets.length) {
root.innerHTML = `
Backtest
No backtest of ${esc(m.name)} is published yet.
`;
return;
}
const days = Object.fromEntries(targets.map(t => [t, allDays[t]]));
CONFIGS = meta.configs.map(c => c.name).filter(c => targets.some(t => days[t].configs[c]));
const type = Object.fromEntries(meta.configs.map(c => [c.name, c.type]));
const info = Object.fromEntries(CONFIGS.map(c => [c, parseConfig(c, wx)]));
const label = c => cfgLabel(c, wx);
const lb = leaderboard(days, meta.baseline), t0 = targets[0], live = meta.live_config[m.id];
const top = lb.filter(r => r.config !== live && r.config !== meta.baseline).slice(0, 2).map(r => r.config);
let sel = [live, meta.baseline, ...top].filter(c => CONFIGS.includes(c)), types = new Set(), absolute = false, sortK = "rank", sortDir = 1;
root.innerHTML = `
Backtest
Test year 1 Nov 2025 – 31 Oct 2026. Each forecast is made at 14:00 ${m.city} on D-1 from data published before then, and scored per local day as Predico does. Lower is better. ${m.missingTruth}
Leaderboard
Scores relative to ${esc(meta.baseline)} (= 1.000) on the days both are scored. Highlighted: the live config. Hover a model for its config name; click a column to sort.
Coverage: share of quarter-hours inside [q10, q90]; a calibrated model gets 80%.
Score: geometric mean of the ${targets.length > 1 ? "four normalised values (RMSE and Winkler, both targets)" : "two normalised values (RMSE and Winkler)"}; rank sorts by it.
Configs in the charts below
Same colour = same model family; dash = variant.
Day viewer
The configs selected above, line styles as there. Times in UTC.
${targetSeg("dv-t", targets, t0)}
lines: q50 of each configq10–q90 (first selected)actual
`;
let range = "90", kind = "miss";
const ts = mount(root.querySelector("#tg-ts"), (w, h) => new uPlot({
width: w, height: h, tzDate: tzUTC, legend: { show: false }, scales: { x: { time: true } },
cursor: { drag: { x: true, y: false }, points: { size: 6, width: 2, fill: css("--surface") }, bind: { dblclick: () => () => { setR(range); return null; } } },
series: [{}, line(LABEL[t], css("--accent-ink"), { width: 1.25 })],
axes: axes(`${LABEL[t]} (${meta.units[t]})`),
plugins: [tooltip(seriesRows(fmtUTC))],
}, [x, target[t]], root.querySelector("#tg-ts")), chartHeight);
ts.keepX = true;
const setR = r => { range = r; ts.inst.setScale("x", { min: r === "all" ? x[0] : x[n - 1] - +r * 86400, max: x[n - 1] }); };
onSeg(root, "tg-r", setR);
function quant(a, q) { if (!a.length) return null; const s = Float64Array.from(a).sort(); const p = (s.length - 1) * q, lo = Math.floor(p); return s[lo] + (s[Math.min(lo + 1, s.length - 1)] - s[lo]) * (p - lo); }
function profile(keyFn, keys) {
const g = new Map(keys.map(k => [k, []]));
target[t].forEach((v, i) => { if (v != null) g.get(keyFn(i))?.push(v); });
return { mean: keys.map(k => mean(g.get(k))), q10: keys.map(k => quant(g.get(k), 0.1)), q90: keys.map(k => quant(g.get(k), 0.9)) };
}
const months = [...new Set(cal.map(c => c.month))];
const monthIdx = new Map(months.map((m, i) => [m, i]));
const monthName = i => `${MON[+months[i].slice(5) - 1]} ${months[i].slice(0, 4)}`;
const PROFILES = [
["tg-p1", "Quarter-hour of day", i => cal[i].hour * 4 + Math.floor((x[i] % 3600) / 900), Array.from({ length: 96 }, (_, i) => i), i => `${pad(i / 4)}:00`, i => `${pad(Math.floor(i / 4))}:${pad((i % 4) * 15)}`, 16],
["tg-p2", "Weekday", i => cal[i].wd, [0, 1, 2, 3, 4, 5, 6], i => WEEKDAYS[i], i => WEEKDAYS[i], 1],
["tg-p3", "Month", i => monthIdx.get(cal[i].month), months.map((_, i) => i), i => `${MON[+months[i].slice(5) - 1]}\n${months[i].slice(2, 4)}`, monthName, 3],
];
const profCharts = PROFILES.map(([id, title, keyFn, keys, tick, ttl, step]) => mount(root.querySelector(`#${id}`), (w, h) => {
const p = profile(keyFn, keys);
return new uPlot({ width: w, height: h, title, legend: { show: false }, scales: { x: { time: false } }, cursor: { points: { size: 5, width: 2, fill: css("--surface") } },
series: [{}, { stroke: css("--accent"), width: 1, points: { show: false } }, { stroke: css("--accent"), width: 1, points: { show: false } }, line("Mean", css("--accent-ink"), { width: 2 })],
bands: [{ series: [2, 1], fill: css("--band") }],
axes: axes("", (u, s) => s.map(i => (Number.isInteger(i) && i in keys ? tick(i) : "")), { space: 20, incrs: [step] }),
plugins: [tooltip((u, i) => ttHTML(ttl(i), [[css("--accent-ink"), "Mean", f1(p.mean[i])], [css("--accent"), "q10–q90", `${f1(p.q10[i])} … ${f1(p.q90[i])}`]]))],
}, [keys, p.q10, p.q90, p.mean], root.querySelector(`#${id}`));
}, 230));
function stats() {
const v = target[t].filter(a => a != null), s = Float64Array.from(v).sort(), m = mean(v);
const sd = Math.sqrt(mean(v.map(a => (a - m) ** 2)));
root.querySelector("#tg-k").innerHTML = kpi("Mean", f1(m), meta.units[t]) + kpi("Std", f1(sd)) +
kpi("Exact zeros", pct(v.filter(a => a === 0).length / v.length)) + kpi("Negative", pct(v.filter(a => a < 0).length / v.length)) +
kpi("Min / max", `${minus(Math.round(s[0]))} / ${Math.round(s[s.length - 1])}`);
return s;
}
const hist = mount(root.querySelector("#tg-h"), (w, h) => {
const s = stats(), lo = quant(s, 0.005), hi = quant(s, 0.995), bins = 80, width = (hi - lo) / bins;
const counts = new Array(bins).fill(0);
for (const v of s) counts[Math.min(bins - 1, Math.max(0, Math.floor((Math.min(Math.max(v, lo), hi) - lo) / width)))]++;
const centers = counts.map((_, i) => lo + (i + 0.5) * width);
return new uPlot({ width: w, height: h, legend: { show: false }, scales: { x: { time: false } }, cursor: { points: { show: false } },
series: [{}, { label: "Quarter-hours", stroke: css("--accent-ink"), fill: css("--band"), paths: uPlot.paths.bars({ size: [0.92, 100] }), points: { show: false } }],
axes: axes("Quarter-hours", (u, sp) => sp.map(v => minus(Math.round(v))), { space: 50 }),
plugins: [tooltip((u, i) => ttHTML(`${f1(centers[i] - width / 2)} … ${f1(centers[i] + width / 2)}`, [[css("--accent-ink"), "Quarter-hours", counts[i].toLocaleString("en-GB")]]))],
}, [centers, counts], root.querySelector("#tg-h"));
}, 280);
// Scatter on a plain canvas (5,000 points; static). Spain only: price vs energy.
const scEl = root.querySelector("#tg-sc");
const pairs = []; if (scatter) for (let i = 0; i < n; i++) if (target.energy[i] != null && target.price[i] != null) pairs.push([target.energy[i], target.price[i]]);
let seed = 1; const rnd = () => ((seed = (seed * 16807) % 2147483647) / 2147483647);
const sample = Array.from({ length: Math.min(5000, pairs.length) }, () => pairs[Math.floor(rnd() * pairs.length)]);
const drawScatter = w => {
const dpr = devicePixelRatio || 1, h = 360; scEl.width = w * dpr; scEl.height = h * dpr;
const ctx = scEl.getContext("2d"); ctx.scale(dpr, dpr); ctx.clearRect(0, 0, w, h);
const xs = sample.map(p => p[0]), ys = sample.map(p => p[1]);
const qx = [quant(xs, 0.002), quant(xs, 0.998)], qy = [quant(ys, 0.002), quant(ys, 0.998)];
const L = 58, B = 40, X = v => L + ((v - qx[0]) / (qx[1] - qx[0])) * (w - L - 12), Y = v => h - B - ((v - qy[0]) / (qy[1] - qy[0])) * (h - B - 10);
ctx.font = `11px ${css("--mono")}`; ctx.fillStyle = css("--ink-soft"); ctx.strokeStyle = css("--grid");
for (let k = 0; k <= 4; k++) {
const vx = qx[0] + ((qx[1] - qx[0]) * k) / 4, vy = qy[0] + ((qy[1] - qy[0]) * k) / 4;
ctx.beginPath(); ctx.moveTo(X(vx), 10); ctx.lineTo(X(vx), h - B); ctx.stroke(); ctx.fillText(minus(Math.round(vx)), X(vx) - 14, h - B + 16);
ctx.beginPath(); ctx.moveTo(L, Y(vy)); ctx.lineTo(w - 12, Y(vy)); ctx.stroke(); ctx.fillText(minus(Math.round(vy)), 8, Y(vy) + 4);
}
ctx.font = `12px ${css("--sans")}`;
ctx.fillText("Net mFRR energy (MWh)", L, h - 6);
ctx.fillStyle = css("--accent-ink"); ctx.globalAlpha = 0.28;
for (const [a, b] of sample) if (a >= qx[0] && a <= qx[1] && b >= qy[0] && b <= qy[1]) ctx.fillRect(X(a) - 1.2, Y(b) - 1.2, 2.4, 2.4);
ctx.globalAlpha = 1; ctx.fillStyle = css("--ink-soft"); ctx.fillText("Price (EUR/MWh) ↑", L + 6, 22);
};
if (scatter) mount(scEl, w => { drawScatter(w); return { destroy() {}, setSize: ({ width }) => drawScatter(width) }; }, 360);
function heat() {
const per = new Map();
target[t].forEach((v, i) => { const k = cal[i].day; per.set(k, (per.get(k) ?? 0) + (kind === "miss" ? v == null : v === 0)); });
const max = Math.max(1, ...per.values()), total = [...per.values()].reduce((a, b) => a + b, 0);
root.querySelector("#tg-ms").textContent = `${kind === "miss" ? "Missing" : "Exactly zero"} quarter-hours per day: ${total.toLocaleString("en-GB")} of ${n.toLocaleString("en-GB")} (${pct(total / n)}).${t === "energy" && kind === "miss" ? " Energy gaps were filled with 0 upstream: use Exact zeros to see them." : ""}`;
let html = `${Array.from({ length: 31 }, (_, d) => `${d % 5 === 0 ? d + 1 : ""}`).join("")}`;
for (const m of months) {
html += `${MON[+m.slice(5) - 1]} ${m.slice(2, 4)}`;
for (let d = 1; d <= 31; d++) {
const k = `${m}-${pad(d)}`, v = per.get(k);
html += v == null ? `` : ``;
}
}
root.querySelector("#tg-heat").innerHTML = html;
}
heat();
setR(range);
onSeg(root, "tg-mk", v => { kind = v; heat(); });
onSeg(root, "tg-t", v => {
t = v; heat();
rebuild(ts); setR(range);
profCharts.forEach(rebuild); rebuild(hist);
});
}
// --- Input features ----------------------------------------------------------------------
async function renderInputs(root) {
const cat = await json("catalog.json"), used = await liveFeatures(mk());
const groups = new Set(cat.flatMap(r => (r.group ? r.group.split(", ") : [])));
const cats = [...new Set(cat.map(r => r.category))].map(c => ({ c, n: cat.filter(r => r.category === c).length, used: cat.filter(r => r.category === c && r.used).length })).sort((a, b) => b.used - a.used || b.n - a.n);
root.innerHTML = `
Input features
Every series we could feed a model. ESIOS serves indicators (time series), offer indicators (bid curves) and archives (bulk files). Calendar columns are computed. Used marks series in a feature group of configs/groups.toml; availability future = known for the target day before the gate, past = only known up to the forecast origin. Categories come from keyword rules on the English name, so a few rows may sit in the wrong bucket.
${used.size ? `
Used by the live model
The ${used.size} input columns of the latest live run (besides the target's own history).
`;
};
["in-c", "in-u"].forEach(id => root.querySelector(`#${id}`).addEventListener("change", draw));
root.querySelector("#in-q").addEventListener("input", draw);
root.querySelector("#in-more").addEventListener("click", () => { limit = Infinity; draw(); });
draw();
}
// Feature columns the latest live run of each of the market's targets used (live.json).
async function liveFeatures(m) {
const [live, meta] = await Promise.all([json("live.json").catch(() => null), json("meta.json")]), out = new Set();
for (const t of shortsOf(m, meta)) for (const f of live?.targets?.[t]?.features ?? []) out.add(f);
return out;
}
// Outside Spain: the market's feature columns from configs/groups.toml (build.py writes them),
// and a map of the weather points with their weights where the market reads Open-Meteo.
async function renderFeatures(root) {
const m = mk(), rows = (await json("features.json"))[m.id], used = await liveFeatures(m);
const geo = (await json("geo.json").catch(() => ({})))[m.id];
const wx = (await json("weather.json").catch(() => ({})))[m.id];
root.innerHTML = `
Input features
The columns the ${esc(m.name)} models see, one line each in configs/groups.toml. Availability future = known for the target day before the gate, past = only known up to the forecast origin. Live marks the columns the latest live run used.
${geo ? `
Weather sampling
${geo.sets.map(s => `${s.points.length} points (${s.weighted ? "weighted by PV capacity; dot size = weight" : "plain mean"}): ${s.runs.join(" and ")} run of D-1`).join(" · ")}. Outline: ${esc(geo.label)}.
Boundaries: ${esc(geo.credit)}.
` : ""}
${wx ? weatherTimeline(wx, m) : ""}
Feature columns
${rows.length} columns · ${rows.filter(r => used.has(r.column)).length} in the latest live run
Live
Group
Column
Source
Availability
Description
${rows.map(r =>
`
${used.has(r.column) ? 'live' : ""}
${esc(r.group)}
${esc(r.column)}
${esc(r.source)}
${esc(r.availability)}
${esc(r.description)}
`).join("")}
`;
// In the chart registry, so a theme switch redraws it in the new colours.
if (geo && window.L) mount(root.querySelector("#ft-map"), () => drawMap(root.querySelector("#ft-map"), geo, CITIES[m.c] ?? []), 440);
}
// A few major cities as labels on the plain map.
const CITIES = {
be: [["Brussels", 50.85, 4.35], ["Antwerp", 51.22, 4.40], ["Ghent", 51.05, 3.72], ["Liège", 50.63, 5.57], ["Charleroi", 50.41, 4.44]],
de: [["Berlin", 52.52, 13.40], ["Hamburg", 53.55, 9.99], ["Leipzig", 51.34, 12.37], ["Dresden", 51.05, 13.74], ["Rostock", 54.09, 12.10]],
};
function drawMap(el, geo, cities) {
const map = L.map(el, { scrollWheelZoom: false, attributionControl: false });
const regions = L.geoJSON(geo.regions, {
style: { color: css("--accent-ink"), weight: 1.5, fillColor: css("--accent"), fillOpacity: 0.12 },
onEachFeature: (f, layer) => layer.bindTooltip(esc(f.properties.name)),
});
const bounds = regions.getBounds();
for (const s of geo.sets) for (const [lat, lon] of s.points) bounds.extend([lat, lon]);
map.fitBounds(bounds.pad(0.05)); // view first: vector layers added to a map without one throw
// No tiles: the country on the grey background, the regions we use, a few cities.
if (geo.country) L.geoJSON(geo.country, { interactive: false, style: { color: css("--ink-soft"), weight: 1.5, fillColor: css("--surface"), fillOpacity: 1 } }).addTo(map);
regions.addTo(map);
for (const [name, lat, lon] of cities)
L.marker([lat, lon], { icon: L.divIcon({ className: "city", html: `${esc(name)}`, iconSize: null, iconAnchor: [3, 8] }), interactive: false, keyboard: false }).addTo(map);
for (const s of geo.sets) for (const [lat, lon, w] of s.points) {
const r = s.weighted ? 5 + Math.sqrt(w) * 30 : 7;
L.circleMarker([lat, lon], { radius: r, color: css("--surface"), weight: 2, fillColor: css("--tso"), fillOpacity: 0.9 })
.bindTooltip(`${lat.toFixed(2)}, ${lon.toFixed(2)}${s.weighted ? ` · weight ${(w * 100).toFixed(1)}%` : ""} ${s.runs.join(", ")}`)
.addTo(map);
}
return { destroy: () => map.remove(), setSize: () => map.invalidateSize() };
}
// --- Weather runs timeline (Input features, targets that read Open-Meteo) -------------------
// One row per weather model: each archived run as a bar from init to when it is on the API
// (openmeteo.LATENCY), the run we read highlighted; origin, submit and gate as vertical lines.
// Intraday: the target day, no chosen run yet, a gate every hour. The axis is in the market's
// local time, like the origin and gate; runs keep their UTC names in the hover text and table.
function weatherTimeline(w, m) {
const intraday = !!m.intraday, H = 3600, OTHER = "color-mix(in srgb, var(--ink-soft) 40%, transparent)";
const t0 = intraday ? w.day_start : Math.min(...w.models.map(r => r.used)) - 6 * H;
const t1 = intraday ? w.day_end : w.gate + 2 * H;
const L = 150, R = 20, W = 900, rowH = 30, top = 22, n = w.models.length, plotH = n * rowH, Hh = top + plotH + 30;
const X = s => L + ((s - t0) / (t1 - t0)) * (W - L - R);
const hm = s => { const d = new Date(s * 1000); return `${pad(d.getUTCHours())}:${pad(d.getUTCMinutes())}`; };
const local = new Intl.DateTimeFormat("en-GB", { timeZone: m.tz, hour: "2-digit", minute: "2-digit", hourCycle: "h23" });
const loc = s => local.format(new Date(s * 1000));
const date = new Intl.DateTimeFormat("en-GB", { timeZone: m.tz, day: "numeric", month: "short" });
const dur = s => `${Math.floor(s / H)}h${pad(Math.round((s % H) / 60))}`;
// ponytail: one UTC offset for the whole window (no DST switch inside it).
const utc = new Intl.DateTimeFormat("en-GB", { timeZone: m.tz, timeZoneName: "shortOffset" }).formatToParts(new Date(t0 * 1000)).find(p => p.type === "timeZoneName").value.replace("GMT", "UTC");
const off = (+utc.slice(3) || 0) * H, city = m.city, zone = `${city} time (${utc})`;
let svg = `${esc(zone)}`;
for (let s = Math.ceil((t0 + off) / (3 * H)) * 3 * H - off; s <= t1; s += 3 * H) { // grid every 3 local hours
svg += ``;
svg += `${loc(s)}`;
if (loc(s) === "00:00") svg += `${date.format(new Date(s * 1000))}`;
}
w.models.forEach((r, i) => {
const y = top + i * rowH + rowH / 2;
svg += `${esc(r.name)}`;
const inits = [];
for (let s = Math.floor((t0 - r.latency) / r.cycle) * r.cycle; s < t1; s += r.cycle) inits.push(s);
inits.sort((p, q) => (p === r.used) - (q === r.used)); // the run we read drawn last, on top
// A run slower than the cycle (IFS: out 6h40 after init, every 6 h) overlaps the next one:
// alternate lanes so each bar keeps its own end.
const lanes = Math.ceil(r.latency / r.cycle);
for (const s of inits) {
const a = Math.max(s, t0), b = Math.min(s + r.latency, t1), used = !intraday && s === r.used;
if (b <= a) continue;
const yl = y + (lanes > 1 ? ((Math.round(s / r.cycle) % lanes) - (lanes - 1) / 2) * 9 : 0);
const title = `${r.name} ${hm(s)} UTC run (${loc(s)} ${city}): on Open-Meteo ~${loc(s + r.latency)} ${city} (${hm(s + r.latency)} UTC), ${dur(r.latency)} after init${used ? "; the run we read" : ""}`;
svg += `${esc(title)}`;
if (s + r.latency <= t1) svg += ``;
svg += ``;
}
});
const vline = (s, color, dash, label) =>
`${esc(label)}`;
if (intraday) for (let s = Math.ceil(t0 / H) * H; s < t1; s += H) svg += vline(s, "var(--ink-soft)", "2 3", `Hourly intraday gate ${loc(s)} ${m.city}`);
else {
svg += vline(w.origin, "var(--base)", "6 4", `Origin ${loc(w.origin)} ${m.city} (${hm(w.origin)} UTC)`);
svg += vline(w.submit, "var(--cont)", "2 3", `Live run ${loc(w.submit)} ${m.city} (${hm(w.submit)} UTC)`);
svg += vline(w.gate, "var(--ink)", "", `Predico gate ${loc(w.gate)} ${m.city} (${hm(w.gate)} UTC)`);
}
const legend = intraday
? `run: init → on Open-Meteohourly intraday gates`
: `run we readother runs: init → on Open-Meteoorigin ${loc(w.origin)} ${m.city}live run ${loc(w.submit)}Predico gate ${loc(w.gate)} ${m.city}`;
const rows = w.models.map(r => {
const runs = Array.from({ length: 24 / (r.cycle / H) }, (_, k) => pad((k * r.cycle) / H)).join(", ");
return `
${intraday
? `Today (${fmtDay(w.day)}), chart in ${esc(zone)}. Each archived run from init to when Open-Meteo serves it; Predico's intraday sessions close every hour. Which run the intraday forecasts read is not decided yet.`
: `For tomorrow's session (D-1 = ${fmtDay(w.day)}), chart in ${esc(zone)}; runs keep their UTC names. Each archived run from init to when Open-Meteo serves it (typical delays, measured Nov 2026); the run we read is one that is out well before the ${loc(w.origin)} ${m.city} origin, the same in the backtest and live. Hover a bar for its times.`}
${legend}
Model
Runs (UTC)
Out after
Run we read
${intraday ? "" : `
Out at (${esc(city)})
Margin to origin
`}
${rows}
`;
}
// --- Countries and variables (Predico resources) -------------------------------------------
// data: build.py MARKETS key (target/.json, features.json, geo.json, weather.json).
// city/tz/gateLocal/source/missingTruth/about: tab texts.
const de50Hertz = what => (from, to) => `The truth series from v2/target_50hertz.parquet: ENTSO-E actual generation, ${what}, 50Hertz control area, MW (mean per quarter-hour), 15-min, ${from} – ${to}. As Predico does, points the curve omits repeat the previous value (curve type A03), each series before summing.`;
const COUNTRIES = [
{ id: "es", name: "Spain", program: "EDP", data: "es-mfrr", catalog: true, city: "Madrid", tz: "Europe/Madrid", gateLocal: "17:00 Madrid on D-1", source: "ESIOS",
missingTruth: "Quarter-hours without truth (no mFRR activation, so no price) are left out.",
about: (from, to) => `The truth series from v1/target.parquet: mFRR activated energy (net, MWh per quarter-hour, upward positive) and mFRR price (EUR/MWh), Spain, 15-min, ${from} – ${to}. Missing energy is filled with 0 (no activation); missing price stays empty. No data during the Iberian blackout (28 Apr – 6 May 2025). Prices rise from Jul 2026 (monthly mean ~100 → ~157 EUR/MWh).`,
vars: [{ id: "energy", name: "mFRR energy", resource: "spain_mfrr_energy" }, { id: "price", name: "mFRR price", resource: "spain_mfrr_price" }] },
{ id: "de", name: "Germany", program: "50Hertz", city: "Berlin", tz: "Europe/Berlin", gateLocal: "15:00 Berlin on D-1", source: "ENTSO-E", missingTruth: "",
vars: [
{ id: "wind", name: "Wind", resource: "germany_wind_50hertz_ca", data: "de-wind", about: de50Hertz("wind offshore + onshore (A75 B18 + B19)") },
{ id: "solar", name: "Solar", resource: "germany_solar_50hertz_ca", data: "de-solar", about: de50Hertz("solar (A75 B16)") },
] },
{ id: "be", name: "Belgium", program: "Elia", data: "be-solar", city: "Brussels", tz: "Europe/Brussels", gateLocal: "10:00 Brussels on D-1", source: "Elia", missingTruth: "",
about: (from, to) => `The truth series from target_elia.parquet: Elia's measured PV generation, Belgium total (TSO + DSO connected), MW (mean per quarter-hour), 15-min, ${from} – ${to}. Elia dataset ods032 up to 25 Oct 2026, then ods209 (and ods210 for the latest hours), as Predico scores it. The same series scores the D+1 and the intraday sessions.`,
vars: [
{ id: "solar", name: "Solar D+1", resource: "belgium_solar_opendata_elia" },
{ id: "solar-intraday", name: "Solar intraday", resource: "belgium_solar_opendata_elia", intraday: true, gateLocal: "every hour, intraday" },
] },
];
const TABS = { live: renderLive, backtest: renderBacktest, target: renderTarget, inputs: root => (mk().catalog ? renderInputs : renderFeatures)(root) };
const TAB_NAMES = { live: "Live", backtest: "Backtest", target: "Target data", inputs: "Input features" };
const saved = (() => { try { return JSON.parse(localStorage.getItem("sel")) ?? {}; } catch { return {}; } })();
let sel = { c: "es", v: "energy", tab: "live" };
// Hash: #//; missing parts fall back to the last choice.
function parseHash() {
const [a, b, c] = location.hash.slice(1).split("/");
if (TABS[a]) return { ...sel, ...saved, tab: a }; // old links: #live, #backtest, ...
const C = COUNTRIES.find(x => x.id === a) ?? COUNTRIES.find(x => x.id === saved.c) ?? COUNTRIES[0];
const V = C.vars.find(x => x.id === b) ?? C.vars.find(x => x.id === saved.v) ?? C.vars[0];
return { c: C.id, v: V.id, tab: TABS[c] ? c : TABS[saved.tab] ? saved.tab : "live" };
}
const href = (c, v, tab) => `#${c}/${v}/${tab}`;
// Live and backtest of the intraday sessions: not wired yet, say so without inventing data.
function intradaySoon(root, tab) {
const m = mk();
root.innerHTML = `
${esc(TAB_NAMES[tab])}: ${esc(m.name)}
being added
Predico's Elia program also runs hourly intraday sessions for Belgian solar, with challenges that start the same day. Our hourly intraday submissions are being added; the D+1 forecast does not cover them. ${tab === "live" ? "Their forecasts appear here after each gate, once they run." : "A backtest follows once the intraday runs exist."}
Predico resource
${esc(m.resource)}
Gates
every hour, intraday
Truth
Elia Open Data, Belgium total (same as D+1)
Benchmark
Elia's most recent forecast (mostrecentforecast in ods032/ods209/ods210)