Report how well the base coefficients are identified

The base layer (loss, heat, bias) showed values only, so a zone with weeks of
samples looked equally trustworthy whether or not the data ever varied its
inputs. Each base coefficient now reports a confidence from its own posterior
variance, as the extended and ventilation layers already did: it stays at 0
for `heat` while the relay never cycles and below 0.8 for `loss` and `bias`
while the indoor-outdoor difference is steady. Readiness is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
buzeraandClaude Opus 5.5 committed 2026-10-27 03:49:13 +02:00
1 parent 26c415fa6c
commit a44163a57d
4 files changed
+47 -2

No files matched your search

+6 -2
View File
@@ -431,8 +431,10 @@ class HeatingMPCCoordinator(DataUpdateCoordinator[dict[str, Any]]):
model = ZoneModel(self.learners[key], self.extended.get(key), self.ventilation.get(key))
inputs = {"outside": outside, "lag": lag, "internal": internal[key], "temps": temps,
"ventilation": vent_inputs.get(key) or {}}
a, b, c = self.learners[key].theta
coefficients = {"base": {"loss": round(a, 6), "heat": round(b, 6), "bias": round(c, 6)}}
base = self.learners[key]
confidence = base.confidence()
coefficients = {"base": {name: {"value": round(value, 6), "confidence": confidence[name]}
for name, value in zip(("loss", "heat", "bias"), base.theta)}}
for layer, learner in (("extended", model.extended), ("ventilation", model.ventilation)):
if learner is not None:
coefficients[layer] = {name: {k: info[k] for k in ("value", "std", "confidence", "identified")}
@@ -740,6 +742,8 @@ class HeatingMPCCoordinator(DataUpdateCoordinator[dict[str, Any]]):
"loss": round(model.theta[0], 6),
"heat": round(model.theta[1], 6),
"bias": round(model.theta[2], 6),
# How well the data pins each coefficient down, not how many samples.
"confidence": model.confidence(),
"samples": model.count,
"on_samples": model.on_count, "off_samples": model.off_count,
"rejected_samples": model.rejected_count,