Technical approach

Calculation methods, written down.

Every stored forecast, anomaly and scenario records the version identifier below, so results can be reproduced and compared when methods change.

Import validation

import-v1

Accepted timestamps: ISO-8601 with or without UTC offset, or Unix seconds/milliseconds. Timestamps without an offset are interpreted in the facility's IANA time zone and the count is reported.

Rows are rejected for unparseable timestamps, non-numeric or negative values, or a meter column that does not match the selected meter. Duplicate intervals keep the first value; conflicting values are reported.

Unit conversion to kWh uses exact factors: Wh ×0.001, MWh ×1000, MJ ÷3.6, GJ ×277.78, therm ×29.3071, MMBtu ×293.071. Volume units are not accepted because they need a supplier calorific value.

Gaps are runs of missing intervals. Completeness = valid intervals ÷ expected intervals between first and last reading. Quality score = 100 × (0.6 × completeness + 0.4 × valid rows ÷ total rows).

Demand, baseload and cost

calc-v1

Interval demand (kW) = interval energy (kWh) × 60 ÷ interval minutes. Peak demand is the maximum interval demand. Baseload is the 10th percentile of interval demand. Load factor = average ÷ peak demand.

Cost estimate = peak-period kWh × peak rate + off-peak kWh × off-peak rate + Σ months (maximum monthly kW × demand charge). Taxes, fixed charges, ratchets and contractual minimums are excluded.

Forecasting

forecast-v1

Readings are aggregated to hourly totals. Three models are fitted only on data before a 168-hour holdout window: (1) seasonal naive — value one week earlier; (2) hour-of-week mean over the last 4 weeks; (3) ridge regression (λ = 1) on 3 hour-of-day Fourier harmonics, day-of-week indicators, a weekend × hour interaction and the 1-week lag.

MAE, RMSE, MAPE and WAPE are reported on the holdout. The lowest-MAE model is refitted on all data and forecasts up to 168 hours. The band is the empirical 10th–90th percentile of holdout residuals (nominal 80%), assumed constant over the horizon.

At least 21 days of hourly data are required. Weather, occupancy and calendar inputs are not used unless supplied; no such inputs are currently ingested.

Anomaly detection

anomaly-v1

Hourly: robust z = 0.6745 × (observed − median) ÷ MAD, comparing each hour to the same hour-of-week in the previous four weeks (at least 3 required). |z| ≥ 3.5 is flagged; consecutive flags of the same sign form one event.

Events are labelled out-of-hours load (all hours outside configured operating hours), abnormal peak (includes the day's maximum), unexpected drop (negative z — often a data issue) or unusual consumption.

Baseline shift: 7-day mean daily consumption compared with the prior 14 days; flagged when the change exceeds 20% and the Welch t-statistic exceeds 4.

Detection describes a statistical deviation. It does not identify a physical cause.

Scenario simulation

scenario-v1

Applied in order to each historical interval: out-of-hours load above baseload is reduced by the chosen percentage; demand above the cap (a percentage of observed peak) is curtailed and not shifted; a flat efficiency reduction is applied. Costs are recomputed with the scenario tariff.

Scenario outputs are hypothetical and are not measured savings.

Emissions estimates

calc-v1

Estimated kg CO₂e = consumption (kWh) × user-selected factor (kg CO₂e/kWh). Cantilever does not ship default factors; each factor records source, geography, period and scope.

Action results

calc-v1

Mean daily consumption for the 28 days after the implementation date is compared with the 28 days before. The comparison is not adjusted for weather, occupancy or production and should not be read as verified savings.

Architecture

The analytics engine is a TypeScript module with unit tests, executed in the application. Data is stored in PostgreSQL with row-level security per organisation. Readings keep the original value and unit next to the normalised kWh; derived analytics are stored in separate tables with calculation versions and an audit log.