Formula reference

Every metric, score and threshold used across the AI Analytics reports, on a single page.

Every formula used across the reports, gathered in one place. Each formula is annotated with the report it belongs to and the context in which it applies. Math is rendered with KaTeX.

Composite scoring — multiplier logic

Combines independent signals as if they were independent probabilities. Used by Metering Bypass (node and fleet).

Scomposite=100(1i=1N(1pi))S_\text{composite} = 100 \cdot \left(1 - \prod_{i=1}^{N}(1 - p_i)\right)

where pi[0,1]p_i \in [0, 1] is the severity-derived probability of the ii-th pattern that fired:

pi={0.00severity=info0.10severity=low0.30severity=medium0.50severity=high0.65severity=high_plusp_i = \begin{cases} 0.00 & \text{severity}=\text{info} \\ 0.10 & \text{severity}=\text{low} \\ 0.30 & \text{severity}=\text{medium} \\ 0.50 & \text{severity}=\text{high} \\ 0.65 & \text{severity}=\text{high\_plus} \end{cases}

Example. Two high+ patterns give S=100(10.352)=87.75S = 100 \cdot (1 - 0.35^2) = 87.75. The score deliberately cannot reach 100 from pattern detection alone — saturating to 100 requires confirmed device events (confidence ceiling = medium without them).

Weighted-sum scoring

Top Problem Nodes (five measurements):

Scomposite=kKwksk,K={battery,telem,quality,risk,events}S_\text{composite} = \sum_{k \in K} w_k \cdot s_k, \quad K = \{\text{battery}, \text{telem}, \text{quality}, \text{risk}, \text{events}\}

Equal weighting, wk=20%w_k = 20\% each.

Top Gas Leaks (four sub-scores, unequal weights):

Sleak=0.4squiet+0.3sbaseline+0.2sdrip+0.1sdriftS_\text{leak} = 0.4 \cdot s_\text{quiet} + 0.3 \cdot s_\text{baseline} + 0.2 \cdot s_\text{drip} + 0.1 \cdot s_\text{drift}

Pattern detectors — Metering Bypass

Pattern 1 — zero flow at a default pressure (severity = high+, p = 0.65):

trigger=(Qˉ0.5m³/h over a window6h)(σP<0.1kPa)(PD)\text{trigger} = (\bar Q \leq 0.5\,\text{m³/h over a window} \geq 6\,\text{h}) \land (\sigma_P < 0.1\,\text{kPa}) \land (P \in \mathcal{D})

D={100.0,101.325,103.0,105.0}±0.5{0.0}±0.3\mathcal{D} = \{100.0, 101.325, 103.0, 105.0\}_{\pm 0.5} \cup \{0.0\}_{\pm 0.3} (kPa). These are the canonical default values a flow computer falls back to when the pressure transducer is disconnected or substituted.

Pattern 2 — zero flow with a stuck pressure (severity = medium, p = 0.30). Violation of the Gay-Lussac law for a sealed gas volume.

trigger=(Qˉ0.5m³/h)(ΔT1°C)(σP<0.1kPa)\text{trigger} = (\bar Q \leq 0.5\,\text{m³/h}) \land (\Delta T \geq 1\text{°C}) \land (\sigma_P < 0.1\,\text{kPa})

Expected ΔP per Gay-Lussac (isochoric process):

P1T1=P2T2    ΔPexpected=Pabs(1)ΔTKT1(K)\frac{P_1}{T_1} = \frac{P_2}{T_2} \;\Longrightarrow\; \Delta P_\text{expected} = P_\text{abs}^{(1)} \cdot \frac{\Delta T_K}{T_1^{(K)}}

where:

  • Pabs(1)=Pgauge+101.325P_\text{abs}^{(1)} = P_\text{gauge} + 101.325 kPa if Pgauge<50P_\text{gauge} < 50 kPa (gauge sensor); otherwise Pabs=PkPaP_\text{abs} = P_\text{kPa}
  • T(K)=T°C+273.15T^{(K)} = T_{°C} + 273.15
  • ΔTK=T2(K)T1(K)=T2°CT1°C\Delta T_K = |T_2^{(K)} - T_1^{(K)}| = |T_2^{°C} - T_1^{°C}| (Kelvin diff ≡ Celsius diff)

“P is frozen” fires when:

ΔPexpectedσP3\frac{\Delta P_\text{expected}}{\sigma_P} \geq 3

False-positive guard — network node. Gay-Lussac only applies to a closed volume. In a node connected to the gas main, gauge pressure is held by the network regulator, not by gas physics. Before the detector fires:

is_network=(median(Pgauge)<10kPa)(σP(window)<2kPa)¬is_p_sensor_broken\text{is\_network} = (\text{median}(P_\text{gauge}) < 10\,\text{kPa}) \land (\sigma_P^\text{(window)} < 2\,\text{kPa}) \land \neg \text{is\_p\_sensor\_broken}

If the node is a network node, all stuck-pressure events are excluded from the score and an informational card is added.

Pattern 3 — recovery after a zero-flow run (severity = high, p = 0.50). Synchronous Q + P jump immediately after a long zero-flow run:

trigger=t[endrun,+2h]:Q(t)10ΔP20kPa\text{trigger} = \exists\, t \in [\text{end}_\text{run}, +2\text{h}] : Q(t) \geq 10 \land |\Delta P| \geq 20\,\text{kPa}

Pattern 4 — gap with clean sessions (severity = medium, p = 0.30). Hours of missing archive while the device was demonstrably reachable:

trigger=(missing_hours24)(successful_sessions_in_gap1)\text{trigger} = (\text{missing\_hours} \geq 24) \land (\text{successful\_sessions\_in\_gap} \geq 1)

Pre-filters (false-positive guards)

SignalThresholdEffect
P sensor brokenP frozen ≥ 168 h at any time in the windowall P-based detectors disabled
Network-connectedmedian(P_gauge) < 10 kPa AND σ_P < 2 kPa AND not brokenstuck-pressure pattern excluded from the score
Telemetry spikeP>500P > 500 kPa OR (Q>20×median(Q)Q > 20 \times \text{median}(Q) while Q > 1000 m³/h)row replaced with NULL before tampering logic

Severity cap, applied after all detectors and before the suspicion score:

Composition of eventsMax allowed level
has high+very high
has highhigh
two or more mediumhigh
exactly one mediummedium
only low or nothingmedium

Coverage and data quality — Consumption Analytics

cov=HOK+HNULLHexpected,unobs%=(1cov)100%\text{cov} = \frac{H_\text{OK} + H_\text{NULL}}{H_\text{expected}}, \quad \text{unobs}_\% = (1 - \text{cov}) \cdot 100\%
ConditionSeverity
tail_h > 168 hcritical
unobs_pct > 30%high
unobs_pct > 10%medium
otherwiselow

Estimated unobserved volume (two methods). Mean-flow extrapolation:

Vunobs(mean)=QˉOKHunobsV^{(\text{mean})}_\text{unobs} = \bar Q_\text{OK} \cdot H_\text{unobs}

Diurnal-profile reconstruction:

Vunobs(profile)=hunobsQˉhV^{(\text{profile})}_\text{unobs} = \sum_{h \in \text{unobs}} \bar Q_h

Operational idle threshold:

{h:Q(h)<0.05}HOK>0.95idle mode (zero consumption is not penalised)\frac{|\{h : Q(h) < 0.05\}|}{H_\text{OK}} > 0.95 \Rightarrow \text{idle mode (zero consumption is not penalised)}

Q/V reconciliation:

ΔVintegral=hQ(h)1h,ΔVcounter=V(tend)V(tstart)\Delta V_\text{integral} = \sum_h Q(h) \cdot 1\text{h}, \quad \Delta V_\text{counter} = V(t_\text{end}) - V(t_\text{start}) raise Q/V mismatch if ΔVcounterΔVintegralΔVcounter>5%\text{raise Q/V mismatch if } \frac{|\Delta V_\text{counter} - \Delta V_\text{integral}|}{\Delta V_\text{counter}} > 5\%

The 5% tolerance follows OIML R 137 class 1.0 plus an integration round-off allowance.

Sub-scores — Top Problem Nodes

Fast pre-rank (metadata only):

Sfast=dpts(days_since_last_session)+spts(status)S_\text{fast} = d_\text{pts}(\text{days\_since\_last\_session}) + s_\text{pts}(\text{status}) dpts(d)={100d6060+(d30)1.3330d<6020+(d7)1.747d<30d2.85d<7d_\text{pts}(d) = \begin{cases} 100 & d \geq 60 \\ 60 + (d-30) \cdot 1.33 & 30 \leq d < 60 \\ 20 + (d-7) \cdot 1.74 & 7 \leq d < 30 \\ d \cdot 2.85 & d < 7 \end{cases}

spts=30s_\text{pts} = 30 if the device status is not “operational”, otherwise 0.

Battery sub-score (mV):

vpts={100Vlast<300080Vlast<320050Vlast<340025Vlast<36000otherwisev_\text{pts} = \begin{cases} 100 & V_\text{last} < 3000 \\ 80 & V_\text{last} < 3200 \\ 50 & V_\text{last} < 3400 \\ 25 & V_\text{last} < 3600 \\ 0 & \text{otherwise} \end{cases} Sbattery=min(100,vpts+dpts(drop_pct))S_\text{battery} = \min(100, v_\text{pts} + d_\text{pts}(\text{drop\_pct}))

where dpts=30d_\text{pts} = 30 if drop > 10%, 15 if drop > 5%, otherwise 0.

Risk sub-score:

Srisk=11.85imin(capi,αini)S_\text{risk} = \frac{1}{1.85} \sum_i \min(\text{cap}_i, \alpha_i \cdot n_i)
Signal nin_iαi\alpha_icap
quiet_n_pct0.840
n_plateau420
n_neg (binary)2525
n_live_p840
n_pt_resets630
n_drop_rec530

Events sub-score:

ConditionSeventsS_\text{events}
physical AND substitution100
physical only80
substitution only60
metrology / system error only30
no events0

Battery threshold — Battery Forecast and Fleet Battery Forecast

Per-source score (% or mV):

Smetro=clip[0,100](VVcritVfreshVcrit100)S_\text{metro} = \text{clip}_{[0,100]}\left(\frac{V - V_\text{crit}}{V_\text{fresh} - V_\text{crit}} \cdot 100\right)
ScaleVcritV_\text{crit}VfreshV_\text{fresh}
% (metering Li-SOCl₂)2090
mV (telemetry Li-pol)33003600

Composite (weakest link):

Sbattery=min(Smetro,Stelem)S_\text{battery} = \min(S_\text{metro}, S_\text{telem})

Forecast TcritT_\text{crit} (three scenarios):

Tcrit(opt)=tnow+VnowVcritdrop_rateT_\text{crit}^{(\text{opt})} = t_\text{now} + \frac{V_\text{now} - V_\text{crit}}{|\text{drop\_rate}|} Tcrit(real)=Tcrit(opt)(1αaccel)T_\text{crit}^{(\text{real})} = T_\text{crit}^{(\text{opt})} \cdot (1 - \alpha_\text{accel}) Tcrit(pess)=Tcrit(real)0.5T_\text{crit}^{(\text{pess})} = T_\text{crit}^{(\text{real})} \cdot 0.5

When a replacement event is found in the report window, all linear regressions are restricted to the period after the replacement. Otherwise the voltage jump at replacement (for example, 3225 → 4197 mV) gives a spurious positive slope — physically impossible for a non-rechargeable Li-pol.

slopereal=linreg({(ti,vi):titreplacement})\text{slope}_\text{real} = \text{linreg}\big(\{(t_i, v_i) : t_i \geq t_\text{replacement}\}\big)

Telemetry-block replacement. For devices whose battery is a non-cycling telemetry pack, the “day-to-critical from discharge” forecast does not apply. The replacement decision is taken as the worst of three independent criteria.

Calendar age:

age_status={okyage<0.75yexpectedplan0.75yexpectedyage<yexpecteddueyageyexpected\text{age\_status} = \begin{cases} \text{ok} & y_\text{age} < 0.75 \cdot y_\text{expected} \\ \text{plan} & 0.75 \cdot y_\text{expected} \leq y_\text{age} < y_\text{expected} \\ \text{due} & y_\text{age} \geq y_\text{expected} \end{cases}

where yexpected=3y_\text{expected} = 3 years (Li-pol passport life).

Sessions used against the pack budget:

sessions_status={okratio<0.75plan0.75ratio<1.0dueratio1.0,ratio=sessions_used2000\text{sessions\_status} = \begin{cases} \text{ok} & \text{ratio} < 0.75 \\ \text{plan} & 0.75 \leq \text{ratio} < 1.0 \\ \text{due} & \text{ratio} \geq 1.0 \end{cases}, \quad \text{ratio} = \frac{\text{sessions\_used}}{2000}

The 2000-session budget matches a 2000 mAh pack (≈ 1 mAh per session under TX load).

Degradation under load (last 30 d vs 180–150 d ago):

deg_pct=100min(Vold)min(Vrecent)min(Vold)\text{deg\_pct} = 100 \cdot \frac{\min(V_\text{old}) - \min(V_\text{recent})}{\min(V_\text{old})} deg_status={okdeg_pct<3%watch3%deg_pct<8%degradeddeg_pct8%\text{deg\_status} = \begin{cases} \text{ok} & \text{deg\_pct} < 3\% \\ \text{watch} & 3\% \leq \text{deg\_pct} < 8\% \\ \text{degraded} & \text{deg\_pct} \geq 8\% \end{cases}

Final verdict (worst of three):

overall={dueany of {age, sessions, deg}{due, degraded}planelse if any{plan, watch}okotherwise\text{overall} = \begin{cases} \text{due} & \text{any of } \{\text{age, sessions, deg}\} \in \{\text{due, degraded}\} \\ \text{plan} & \text{else if any} \in \{\text{plan, watch}\} \\ \text{ok} & \text{otherwise} \end{cases}

Battery capacity for signal / consumption models:

ΔVperiod=VfirstVlast,ΔCused=ΔVCmAh1200 mV\Delta V_\text{period} = V_\text{first} - V_\text{last}, \quad \Delta C_\text{used} = \Delta V \cdot \frac{C_\text{mAh}}{1200\text{ mV}}

where 1200 mV is the Li-pol voltage swing from nominal to fully discharged (3.0 → 4.2 V). Anomalous-drop detection fires when the drop rate over the last 30 days exceeds twice the 90-day baseline.

Leak detection — Top Gas Leaks

Adaptive per-station threshold:

θleak=max(0.05,P95(Q)0.05)\theta_\text{leak} = \max(0.05, P_{95}(Q) \cdot 0.05)

5% of each station’s own p95 — adaptive, so commercial sites are not flagged at the same threshold as residential ones.

Sub-scores:

squiet=100minh[2,5]Q(h)θleak (capped at 100)s_\text{quiet} = 100 \cdot \frac{\min_{h \in [2,5]} Q(h)}{\theta_\text{leak}} \text{ (capped at 100)} sbaseline=100P5(Q)θleak (capped at 100)s_\text{baseline} = 100 \cdot \frac{P_5(Q)}{\theta_\text{leak}} \text{ (capped at 100)} sdrip=100{h:0.5θQ(h)2θ}Hs_\text{drip} = 100 \cdot \frac{|\{h : 0.5\theta \leq Q(h) \leq 2\theta\}|}{|H|} sdrift=100tanh(slope(P5)θleak/month)s_\text{drift} = 100 \cdot \tanh\left(\frac{\text{slope}(P_5)}{\theta_\text{leak} / \text{month}}\right)

CO₂e calculations — Decarbonization and Emissions and Energy

Methane → CO₂e:

mCH4=VleakϕCH4ρCH4,ρCH4=0.68 kg/m³m_\text{CH4} = V_\text{leak} \cdot \phi_\text{CH4} \cdot \rho_\text{CH4}, \quad \rho_\text{CH4} = 0.68 \text{ kg/m³} mCO2e(GWP100)=mCH428,mCO2e(GWP20)=mCH484m_\text{CO2e}^{(\text{GWP100})} = m_\text{CH4} \cdot 28, \quad m_\text{CO2e}^{(\text{GWP20})} = m_\text{CH4} \cdot 84

GWP factors per IPCC AR6 (the 20-year factor reflects the short-term warming impact relevant for near-term mitigation targets).

Direct CO₂ (from burnt gas):

mCO2,direct=VconsumedEFCO2,EFCO2=1.96 kg/m³m_\text{CO2,direct} = V_\text{consumed} \cdot \text{EF}_\text{CO2}, \quad \text{EF}_\text{CO2} = 1.96 \text{ kg/m³}

Energy:

EGJ=VHHV,HHV=37.0 MJ/m³E_\text{GJ} = V \cdot \text{HHV}, \quad \text{HHV} = 37.0 \text{ MJ/m³} EkWh=EGJ10003.6E_\text{kWh} = E_\text{GJ} \cdot \frac{1000}{3.6}

Investment scenarios — Decarbonization and Automation ROI

CAPEX / OPEX (per node):

CAPEXtotal=Ncapex_per_node,OPEX/year=Nopex_per_node_per_year\text{CAPEX}_\text{total} = N \cdot \text{capex\_per\_node}, \quad \text{OPEX}/\text{year} = N \cdot \text{opex\_per\_node\_per\_year}

Value / Payback:

Value/year=hot spots(gas+carbonGWP100)\text{Value}/\text{year} = \sum_\text{hot spots}(\text{gas} + \text{carbon}_\text{GWP100}) Paybackmonths={CAPEXValueOPEX12Value>OPEXnoneotherwise\text{Payback}_\text{months} = \begin{cases} \dfrac{\text{CAPEX}}{\text{Value} - \text{OPEX}} \cdot 12 & \text{Value} > \text{OPEX} \\ \text{none} & \text{otherwise} \end{cases}

ROI / TCO:

ROI=Value/yearOPEX/yearCAPEXtotal100%\text{ROI} = \frac{\text{Value/year} - \text{OPEX/year}}{\text{CAPEX}_\text{total}} \cdot 100\% TCO5=CAPEXtotal+5OPEX/year\text{TCO}_5 = \text{CAPEX}_\text{total} + 5 \cdot \text{OPEX/year}

Demand forecasting — Gas Demand Forecast

Linear model (OLS):

Q(t)=β0+β1t+k=12[αksin(2πkt/365)+γkcos(2πkt/365)]+j=16wj1dow=j+δHDD(t)+εQ(t) = \beta_0 + \beta_1 t + \sum_{k=1}^{2}[\alpha_k \sin(2\pi k t/365) + \gamma_k \cos(2\pi k t/365)] + \sum_{j=1}^{6} w_j \mathbb{1}_{\text{dow}=j} + \delta \cdot \text{HDD}(t) + \varepsilon

Trend + two-harmonic annual seasonality + day-of-week dummies + a heating-degree-day term.

HDD:

HDD(t)=max(0,18°CTˉ(t))\text{HDD}(t) = \max(0, 18°C - \bar T(t))

95% CI:

Q^(t)±1.96σ^ε1+h(t)\hat Q(t) \pm 1.96 \cdot \hat\sigma_\varepsilon \cdot \sqrt{1 + h(t)}

Backtest:

MAE=1NtQ(t)Q^(t),MAPE=1NtQ(t)Q^(t)Q(t)100%\text{MAE} = \frac{1}{N} \sum_t |Q(t) - \hat Q(t)|, \quad \text{MAPE} = \frac{1}{N} \sum_t \frac{|Q(t) - \hat Q(t)|}{Q(t)} \cdot 100\% Coverage95%=1Nt1Q(t)[Q^t±1.96σ^]\text{Coverage}_{95\%} = \frac{1}{N} \sum_t \mathbb{1}_{Q(t) \in [\hat Q_t \pm 1.96\hat\sigma]}

Healthy fit: coverage ≈ 95%, MAPE < 15%.

Pressure anomalies — Pressure Anomalies

Outage:

outage(t)=1P(t)=nullP(t)=0\text{outage}(t) = \mathbb{1}_{P(t) = \text{null} \lor P(t) = 0}

Sharp drop:

drop(t)=1P(t1)P(t)>5 kPa/h\text{drop}(t) = \mathbb{1}_{P(t-1) - P(t) > 5 \text{ kPa/h}}

Baseline drift:

drift30d=P5(last 30d)P5(first 30d)P5(first 30d)100%\text{drift}_{30d} = \frac{P_5^{(\text{last 30d})} - P_5^{(\text{first 30d})}}{P_5^{(\text{first 30d})}} \cdot 100\%

Raise a baseline-drift incident if |drift| > 20% over the analyzed period.

Instability (rolling):

instability(t)=σP(24h)Pˉ(24h)\text{instability}(t) = \frac{\sigma_P^{(24h)}}{\bar P^{(24h)}}

Raise an instability incident if the ratio exceeds 0.3 over a window ≥ 6 hours.

Long sessions — IQR detection

Per-station threshold:

θlong=Q3+1.5IQR,IQR=Q3Q1\theta_\text{long} = Q_3 + 1.5 \cdot \text{IQR}, \quad \text{IQR} = Q_3 - Q_1

A robust outlier detector — better than z-score for the skewed distribution of polling-session durations.

Severity score:

S=40long_frac+30tˉanomalyθlong+30n_incidents_criticalS = 40 \cdot \text{long\_frac} + 30 \cdot \frac{\bar t_\text{anomaly}}{\theta_\text{long}} + 30 \cdot \text{n\_incidents\_critical}

Home energy — Household Report

Breakdown template (single-family house):

SegmentShare
Space heating60%
Domestic hot water20%
Cooking10%
Other10%

Savings from insulation:

ΔVinsulation=Vheating0.15 (typical retrofit)\Delta V_\text{insulation} = V_\text{heating} \cdot 0.15 \text{ (typical retrofit)}

Compound interest (savings deposited at rate r):

ReinvestT=Savings(1+r)T1r\text{Reinvest}_T = \text{Savings} \cdot \frac{(1 + r)^T - 1}{r}

Severity classification — unified scale

RangeSeverityColorContext
0–9OKgreencomposite, top problem nodes
10–29Lowbluecomposite
30–49Mediumyellowcomposite
50–69Highorangecomposite, top problem nodes warning
70–100Criticalredcomposite, top problem nodes critical

Top Problem Nodes uses thresholds 30 / 60 — more of the green band is treated as the “normal” state.

Confidence framework — Decarbonization and Metering Bypass

ConfidenceCondition
Highdeep score ≥ 80 with ≥ 6 months of data
Mediumdeep score ≥ 50 or limited data history
Lowlow score / fallback estimation

Field-investigation priority — Metering Bypass

ConditionPriority
Recent physical event (≤ 7 d)P0 (override)
Older physical event (> 7 d)P1
score ≥ 70 with confidence medium or highP0
score ≥ 70 with confidence lowP1
score ≥ 50P1
score ≥ 30P2
score < 30P3

Constants reference

SymbolValueSourceUsed in
EFCO2\text{EF}_\text{CO2}1.96 kg/m³IPCC AR6Decarbonization, Emissions and Energy
HHV\text{HHV}37.0 MJ/m³natural-gas typical (IEA)Emissions and Energy
ρCH4\rho_\text{CH4}0.68 kg/m³standard conditionsDecarbonization
GWP100\text{GWP}_{100}28IPCC AR6, 100-yearDecarbonization, Emissions and Energy
GWP20\text{GWP}_{20}84IPCC AR6, 20-yearDecarbonization, Emissions and Energy
Near-zero flow0.5 m³/hempiricalMetering Bypass
Min zero-flow run6 hempiricalMetering Bypass
Stuck-pressure σ0.1 kPaempiricalMetering Bypass
Min ΔT for Gay-Lussac1.0 °CempiricalMetering Bypass
Recovery Q min10 m³/hempiricalMetering Bypass
Recovery ΔP min20 kPaempiricalMetering Bypass
Physical P max500 kPaphysical limitMetering Bypass pre-filter
Q spike multiplier20×empiricalMetering Bypass pre-filter
P-sensor-broken stuck time168 hempiricalMetering Bypass sensor health
HDD base temperature18 °CIPCCGas Demand Forecast
Default leak fraction0.5%IEA fleet averageDecarbonization fallback

Methodological references: IPCC AR6 (WG I, Ch. 7) for GWP and emission factors; OIML R 137-1 for flow-meter accuracy classes; ISO 5167 and AGA Report No. 3 for differential-pressure flow calculation; EN 1776 for metering-station design conventions; GHG Protocol Scope 1 for direct-combustion CO₂ accounting.

Related topics

Last updated on

Was this page helpful?