Avoided energy
Before and After: Was There a Saving?
On this page
A contractor fits an energy-saving measure, compares the bills before and after, and reports a saving of 23 percent. The owner pays a share of that saving every month. A year later the bills are back where they were, because nearly half of the “saving” was a cool season that has now ended. Nobody lied: the two periods were simply not alike. This lesson shows how to compare a period with what the same building would have used in the same weather without the measure, how to put a range on the result, and how long you must measure before any saving can be claimed at all. #EnergySavings #AdjustedBaseline #MeasurementAndVerification
Learning Objectives
By the end of this lesson, you will be able to:
- Explain why a plain comparison of the periods before and after a measure is usually wrong
- Calculate an adjusted baseline and the avoided energy for a reporting period
- Check a baseline on a period when nothing had changed, before it is trusted
- State a saving with its expanded uncertainty and name what that uncertainty leaves out
- Find the smallest saving that a given baseline can distinguish from zero in a given number of days
Real-World System Problem: A building after a cooling upgrade
An office building uses electricity for cooling, lighting and equipment. Its main meter gives one energy value a day, and an outdoor sensor gives the mean temperature of each day. On day 500 of a two-year record, a measure is installed that is expected to reduce energy use. The owner now asks one question: how much did it save?
The question is harder than it looks, because a saving cannot be measured. A meter measures what was used; the saving is the difference between that and what would have been used without the measure, in the same weather and on the same days. That second quantity never happened. It must be estimated by a model, and the answer is only as good as that model.
The record therefore has three parts with three different jobs. The first year is used to fit the baseline model. The days between the fit and the measure are used to check the model on data it has not seen. The days after the measure are the reporting period.
Fundamental Theory: Adjusted baseline, avoided energy and its range
The naive comparison
The first idea of every owner is to compare mean daily energy before and after.
Here
The adjusted baseline
The baseline model was fitted on data from before the measure. For this building it has two drivers.
is the predicted energy of day in kWh. is the cooling degree days of day , where is the mean outdoor temperature in °C and 18 °C is the base temperature. is 1 on a weekday and 0 on a weekend day. is the base load, is the energy for each cooling degree day, and is the weekday step.
To adjust the baseline, apply the model to each day after the measure, with its real temperature and day of the week. The result is what the old building would have used on those days.
The percentage is taken of the adjusted baseline, not of last year’s bill. “Avoided energy” is the usual name for a saving stated in the conditions of the reporting period.
Check the baseline before you trust it
A model always fits the data it was fitted to. The honest test is a period it has not seen, with nothing changed, where the avoided energy should be zero within the uncertainty given below. A shop checks its scale with a known weight before it weighs goods; this is the same check. If the model reports a “saving” of 4 percent when nothing was done, every later result is wrong by about that amount.
The uncertainty of a saving
The baseline is an estimate, so the saving has an uncertainty. The root mean square error (RMSE) of the baseline is the typical error of one day’s prediction. Daily errors partly cancel when days are added, so the error of a sum grows more slowly than the sum.
Simple uncertainty of the summed baseline
The saving grows in proportion to
This simple form is true only if the daily errors are independent and the coefficients of the model are exact. Neither holds fully on a real site, and three things are left out.
- Uncertainty of the coefficients. If
is 2 kWh too low, it is 2 kWh too low on every day. This error does not cancel. It grows in proportion to and becomes the larger part for long periods. - Autocorrelation of the errors. If a high residual today makes a high residual tomorrow more likely, the errors cancel less than independent errors. With lag-1 autocorrelation
the uncertainty grows by about the factor . - Changes the model cannot see. New tenants, a new server room or longer opening hours change the energy and are not in the model. No statistics correct this. It needs a record of what changed on site.
The smallest saving that can be seen
Turn the uncertainty around. A saving smaller than
Smallest saving distinguishable from zero
The percentage falls as
Reporting a range
A saving is a finding only when it is stated with its period, its adjustment and its uncertainty.
Application 1: The saving from day 500 to day 729
Step 1: Fit the baseline and check it
Click to reveal the baseline and its check
-
Fit by least squares on days 0 to 364.
The base load is 306.6 kWh a day, each cooling degree day adds 41.61 kWh, and a weekday adds 182.1 kWh. ✅
-
Quality of the fit. RMSE is 27.30 kWh (with
in the denominator), is 0.969 and CV(RMSE) is 4.7 percent. One day’s prediction is typically wrong by 27 kWh. ✅ -
Predict the check period. Over days 365 to 499 the model predicts 90,526 kWh. The meter recorded 91,010 kWh. The error is
kWh, which is percent. ✅ -
Is that error acceptable? The expanded uncertainty for 135 days is
The error of 484 kWh is inside 634 kWh. The baseline predicts a period it has not seen, with nothing changed, within its own stated uncertainty. It may be used. ✅
Step 2: The naive saving and why it is wrong
Click to reveal the naive comparison
-
Means of the two periods. Days 0 to 499: 602.3 kWh a day. Days 500 to 729: 465.3 kWh a day. ✅
-
Naive saving.
(The difference is 137.1 with all digits.) The plain comparison reports a saving of 22.8 percent. ✅
-
Compare the weather. The mean outdoor temperature was 21.69 °C before and 19.51 °C after. The mean cooling degree days were 3.95 before and 2.14 after. The period after the measure was much cooler. ✅
-
Compare the weekdays. Weekdays were 71.6 percent of the days before and 71.3 percent after, so the weekday share is not the cause here. On another site, with a holiday month in one period, it would be. ✅
-
Size of the weather effect. With 41.61 kWh for each cooling degree day,
About 75 of the 137 kWh a day come from the cooler weather, not from the measure. ✅
Step 3: Adjusted baseline and avoided energy
Click to reveal the adjusted comparison
-
One day as an example. Day 500 is a weekday with a mean temperature of 25.49 °C, so its CDD is 7.49.
(The script, with all digits, prints 800.5.) The meter recorded 727.2 kWh, so about 73 kWh was avoided on that day. ✅
Before you add the days, check that each one lies inside the range of the baseline data. The reporting days run from 13.3 to 27.9 °C, inside the 12.6 to 29.0 °C of the fitting year, so no day asks the model to extrapolate. A hotter summer after the measure would need that check day by day.
-
All 230 days. Repeat for each day with its own temperature and day of the week, and add.
Without the measure, the building would have used 525.5 kWh a day in this cooler period, not the 602.3 of the earlier period. ✅
-
Avoided energy.
The measure avoided 13,857 kWh in 230 days. ✅
-
As a percentage of the adjusted baseline.
The adjusted saving is 11.5 percent, half of the naive 22.8 percent. ✅
Step 4: Uncertainty and the reported range
Click to reveal the range
-
Standard uncertainty.
The summed baseline has a standard uncertainty of 414 kWh. ✅
-
Expanded uncertainty.
kWh, which is 0.68 percent of the adjusted baseline. ✅ -
The range.
kWh is 13,029 to 14,685 kWh, or 10.8 to 12.1 percent of the adjusted baseline. ✅ -
Check against the truth. The generator reduces energy by 12 percent from day 500. The true avoided energy is therefore
kWh. The estimate is 736 kWh below it, inside the expanded uncertainty of 828 kWh, and the true 12 percent lies inside the range of 10.8 to 12.1 percent. ✅
Application 2: How small a saving could this baseline detect?
Step 1: Smallest saving in kWh
Click to reveal the three thresholds
-
30 days.
A saving below 299 kWh in 30 days cannot be told from zero. ✅
-
90 days.
kWh. ✅ -
230 days.
kWh. ✅ -
Pattern. Three times the days gives
times the threshold: . The threshold in kWh rises with the period, but more slowly than the energy does. ✅
Step 2: As a percentage of the baseline
Click to reveal the percentages
-
Divide each threshold by the baseline energy of its period.
Period Baseline (kWh) Baseline a day (kWh) Smallest saving (kWh) Percent 30 days 21,233 707.8 299 1.41 90 days 56,686 629.8 518 0.91 230 days 120,871 525.5 828 0.68 After 30 days this baseline can see a saving of 1.41 percent, and after 230 days a saving of 0.68 percent. ✅
-
Compare with the square-root rule. If the daily baseline were constant, the percentage would fall by
from 30 to 230 days. Here it falls by . The reason is in the third column: the first 30 days were warm (707.8 kWh a day) and the later days cooler, so the same kWh of uncertainty is a larger share of a smaller baseline. ✅ -
Check with the formula. For 30 days,
The formula and the table agree. ✅
-
Days needed for a given saving. At 525.5 kWh a day, a saving of 1.0 percent needs
and a saving of 0.5 percent needs 432 days, four times as long. ✅
Verify It in Python
The script generates data set B, fits the baseline on the first year, checks it on days 365 to 499, and then prints the naive saving, the adjusted saving with its range, and the smallest detectable saving for the three periods. It saves one figure: the measured energy against the adjusted baseline, and the cumulative avoided energy.
"""Was there a saving? Naive and adjusted comparison for a building's daily energy."""import numpy as npimport matplotlib.pyplot as plt
def building_daily(seed=23, days=730): rng = np.random.default_rng(seed) d = np.arange(days) temp = 21.0 + 4.5 * np.sin(2 * np.pi * (d - 20) / 365.0) + rng.normal(0, 1.6, days) weekday = (d % 7) < 5 # day 0 is a Monday cdd = np.clip(temp - 18.0, 0.0, None) # cooling degree days, base 18 °C energy = 310.0 + 42.0 * cdd + np.where(weekday, 180.0, 0.0) + rng.normal(0, 28.0, days) # an energy-saving measure is installed on day 500: 12 percent less from then on energy[500:] *= 0.88 return d, temp, weekday, energy # kWh a day
d, temp, weekday, energy = building_daily()cdd = np.clip(temp - 18.0, 0.0, None)X = np.column_stack([np.ones(d.size), cdd, weekday.astype(float)])
# ---------- Baseline: fit on days 0 to 364 ----------fit = slice(0, 365)b, *_ = np.linalg.lstsq(X[fit], energy[fit], rcond=None)res = energy[fit] - X[fit] @ bn, p = 365, 3rmse = np.sqrt(np.sum(res ** 2) / (n - p))r2 = 1.0 - np.sum(res ** 2) / np.sum((energy[fit] - energy[fit].mean()) ** 2)r1 = np.sum(res[1:] * res[:-1]) / np.sum(res ** 2)print("Baseline fitted on days 0 to 364")print(f" energy = {b[0]:.1f} + {b[1]:.2f} x CDD + {b[2]:.1f} x weekday")print(f" RMSE {rmse:.2f} kWh, R2 {r2:.3f}, CV(RMSE) " f"{100 * rmse / energy[fit].mean():.1f} %")print(f" lag-1 autocorrelation of residuals {r1:.3f} " f"(noise band 2/sqrt(n) = {2 / np.sqrt(n):.3f})")baseline = X @ b # the model applied to every day
# ---------- Check: days 365 to 499, nothing had changed ----------chk = slice(365, 500)err = energy[chk].sum() - baseline[chk].sum()print("Check on days 365 to 499 (no change yet)")print(f" measured {energy[chk].sum():.0f}, baseline {baseline[chk].sum():.0f}, " f"error {err:+.0f} kWh ({100 * err / baseline[chk].sum():+.2f} %)")print(f" allowed by 2 x RMSE x sqrt(135): {2 * rmse * np.sqrt(135):.0f} kWh")
# ---------- Naive comparison ----------pre, post = slice(0, 500), slice(500, 730)m_pre, m_post = energy[pre].mean(), energy[post].mean()print("Naive comparison of means")print(f" days 0 to 499: {m_pre:.1f} kWh a day, days 500 to 729: {m_post:.1f}")print(f" naive saving {m_pre - m_post:.1f} kWh a day = " f"{100 * (1 - m_post / m_pre):.1f} %")print(f" mean temperature {temp[pre].mean():.2f} and {temp[post].mean():.2f} degC")print(f" mean CDD {cdd[pre].mean():.2f} and {cdd[post].mean():.2f}")print(f" weekday share {100 * weekday[pre].mean():.1f} and " f"{100 * weekday[post].mean():.1f} %")
# ---------- Adjusted baseline and avoided energy ----------m = 230print("Adjusted comparison, days 500 to 729")print(f" day 500: {temp[500]:.2f} degC, CDD {cdd[500]:.2f}, weekday " f"{int(weekday[500])}, baseline {baseline[500]:.1f}, measured {energy[500]:.1f}")B, M = baseline[post].sum(), energy[post].sum()S = B - Mu = rmse * np.sqrt(m)print(f" adjusted baseline {B:.0f} kWh ({B / m:.1f} a day), " f"measured {M:.0f} kWh ({M / m:.1f} a day)")print(f" avoided energy {S:.0f} kWh = {100 * S / B:.2f} % of the adjusted baseline")print(f" standard uncertainty {u:.0f} kWh, expanded (x2) {2 * u:.0f} kWh")print(f" range {S - 2 * u:.0f} to {S + 2 * u:.0f} kWh = " f"{100 * (S - 2 * u) / B:.1f} to {100 * (S + 2 * u) / B:.1f} %")xs = X[post].sum(axis=0)extra = xs @ np.linalg.inv(X[fit].T @ X[fit]) @ xsu_full = rmse * np.sqrt(m + extra)print(f" with coefficient uncertainty: standard {u_full:.0f} kWh, range " f"{S - 2 * u_full:.0f} to {S + 2 * u_full:.0f} kWh = " f"{100 * (S - 2 * u_full) / B:.1f} to {100 * (S + 2 * u_full) / B:.1f} %")print(f" autocorrelation factor sqrt((1+r1)/(1-r1)) = " f"{np.sqrt((1 + r1) / (1 - r1)):.2f}")
true_saving = 0.12 * M / 0.88 # known only because the data is generatedprint(f" true avoided energy {true_saving:.0f} kWh, estimate is " f"{S - true_saving:+.0f} kWh from it")
# ---------- Smallest saving that can be told from zero ----------print("Smallest detectable saving (2 x RMSE x sqrt(m))")for k in (30, 90, 230): part = slice(500, 500 + k) Bk = baseline[part].sum() print(f" {k:3d} days: baseline {Bk:.0f} kWh ({Bk / k:.1f} a day), " f"smallest {2 * rmse * np.sqrt(k):.0f} kWh = " f"{100 * 2 * rmse * np.sqrt(k) / Bk:.2f} %")
for pct in (1.0, 0.5): days = (2 * rmse / (pct / 100 * B / m)) ** 2 print(f" days needed to detect {pct:.1f} % at {B / m:.1f} kWh a day: {days:.0f}")days = (2 * rmse / (0.012 * B / m)) ** 2print(f" days needed to know a 12 % saving within 1.2 points: {days:.0f}")
# ---------- Plot ----------fig, ax = plt.subplots(2, 1, figsize=(8, 7))ax[0].plot(d, energy, linewidth=0.6, label="measured")ax[0].plot(d[365:], baseline[365:], linewidth=0.6, label="adjusted baseline")ax[0].axvline(365, color="gray", linewidth=0.8)ax[0].axvline(500, color="gray", linewidth=0.8)ax[0].set_xlabel("day")ax[0].set_ylabel("energy (kWh a day)")ax[0].set_title("Measured energy and the adjusted baseline")ax[0].legend()gap = np.cumsum(baseline[365:] - energy[365:])ax[1].plot(d[365:], gap)ax[1].axvline(500, color="gray", linewidth=0.8)ax[1].set_xlabel("day")ax[1].set_ylabel("cumulative baseline minus measured (kWh)")ax[1].set_title("Cumulative avoided energy from day 365")fig.tight_layout()fig.savefig("before_and_after_savings.png", dpi=120)print("Saved before_and_after_savings.png")Expected output
Baseline fitted on days 0 to 364 energy = 306.6 + 41.61 x CDD + 182.1 x weekday RMSE 27.30 kWh, R2 0.969, CV(RMSE) 4.7 % lag-1 autocorrelation of residuals 0.087 (noise band 2/sqrt(n) = 0.105)Check on days 365 to 499 (no change yet) measured 91010, baseline 90526, error +484 kWh (+0.53 %) allowed by 2 x RMSE x sqrt(135): 634 kWhNaive comparison of means days 0 to 499: 602.3 kWh a day, days 500 to 729: 465.3 naive saving 137.1 kWh a day = 22.8 % mean temperature 21.69 and 19.51 degC mean CDD 3.95 and 2.14 weekday share 71.6 and 71.3 %Adjusted comparison, days 500 to 729 day 500: 25.49 degC, CDD 7.49, weekday 1, baseline 800.5, measured 727.2 adjusted baseline 120871 kWh (525.5 a day), measured 107014 kWh (465.3 a day) avoided energy 13857 kWh = 11.46 % of the adjusted baseline standard uncertainty 414 kWh, expanded (x2) 828 kWh range 13029 to 14685 kWh = 10.8 to 12.1 % with coefficient uncertainty: standard 544 kWh, range 12768 to 14946 kWh = 10.6 to 12.4 % autocorrelation factor sqrt((1+r1)/(1-r1)) = 1.09 true avoided energy 14593 kWh, estimate is -736 kWh from itSmallest detectable saving (2 x RMSE x sqrt(m)) 30 days: baseline 21233 kWh (707.8 a day), smallest 299 kWh = 1.41 % 90 days: baseline 56686 kWh (629.8 a day), smallest 518 kWh = 0.91 % 230 days: baseline 120871 kWh (525.5 a day), smallest 828 kWh = 0.68 % days needed to detect 1.0 % at 525.5 kWh a day: 108 days needed to detect 0.5 % at 525.5 kWh a day: 432 days needed to know a 12 % saving within 1.2 points: 75Saved before_and_after_savings.pngIn the lower plot the cumulative difference stays near zero until day 500 and then rises almost in a straight line. A flat line followed by a steady rise from the date of the measure is the picture of a real saving.
Common Mistakes
- Comparing the bill after the measure with the bill before it. The two periods have different weather and different numbers of working days. Compare with the adjusted baseline.
- Fitting the baseline to data that includes days after the measure. The model then learns part of the saving and reports less of it.
- Using a baseline that was never tested on a period with no change. An untested model can report a saving that is only its own error.
- Reporting one number without a range. “13,857 kWh” and “13,857 kWh with an expanded uncertainty of 828 kWh” are different statements, and only the second can be checked.
- Dividing the saving by the energy of the period before the measure. The percentage belongs to the adjusted baseline of the reporting period.
- Treating the simple range as the full uncertainty in a contract. It leaves out coefficient error, autocorrelation and changes on site.
Summary
- A saving is the adjusted baseline minus the measured energy, over a stated period. The baseline is the model from before the measure, applied to the weather and weekdays after it.
- For data set B the naive comparison gave 22.8 percent. The adjusted saving was 13,857 kWh, 11.5 percent of the adjusted baseline, against a true 12 percent.
- The simple expanded uncertainty is
: 828 kWh here, a range of 10.8 to 12.1 percent. - The simple form leaves out coefficient uncertainty and autocorrelation. With coefficient uncertainty the range widened to 10.6 to 12.4 percent.
- The smallest saving a baseline can see falls as
: 1.41 percent after 30 days and 0.68 percent after 230 days for this building. - Check the baseline on a period with no change before you use it.
Exercises
1. A baseline model is
Answer
CDD is
2. A site used a mean of 600 kWh a day before a measure and 480 kWh a day after it. The adjusted baseline for the period after is 540 kWh a day. Find the naive saving, the adjusted saving, and the part of the naive figure caused by the change in conditions.
Answer
Naive:
3. A baseline has an RMSE of 25 kWh. Over a reporting period of 100 days the adjusted baseline is 55,000 kWh and the measured energy is 51,700 kWh. Find the avoided energy, its expanded uncertainty by the simple form, and the range in kWh and percent.
Answer
4. A baseline has an RMSE of 30 kWh and a mean daily baseline of 500 kWh. Find the smallest saving distinguishable from zero after 25 days and after 100 days, in kWh and in percent.
Answer
25 days:
5. For the baseline of exercise 4, how many days are needed to distinguish a saving of 1 percent from zero? How many days are needed to state a saving of 2 percent within 0.5 percentage points?
Answer
6. The residuals of the baseline in exercise 3 are found to have a lag-1 autocorrelation of 0.40. Find the factor by which the simple uncertainty grows, the new expanded uncertainty and the new range in kWh.
Answer
Factor:
References
- ASHRAE, Guideline 14-2014: Measurement of Energy, Demand, and Water Savings, ASHRAE, 2014.
- Efficiency Valuation Organization, International Performance Measurement and Verification Protocol (IPMVP): Core Concepts, EVO 10000-1:2022.
- T. A. Reddy and D. E. Claridge, “Uncertainty of ‘Measured’ Energy Savings from Statistical Baseline Models”, HVAC&R Research, vol. 6, no. 1, 2000.
- D. C. Montgomery and G. C. Runger, Applied Statistics and Probability for Engineers, 7th edition, Wiley, 2018.
After a measure, a building's mean daily energy fell from 602 to 465 kWh: 22.8 percent less. The months after the measure were cooler than the months before. What was the real saving of the measure?
- Mean daily energy: 602.3 kWh before the measure on day 500, 465.3 kWh after it.
- The naive comparison calls the whole fall of 137.1 kWh a saving: 22.8 %.
- The baseline model, run on the days after with their weather and calendar, gives 525.5 kWh.
- Of the fall, 76.8 kWh came from cooler days and the calendar; 60.2 kWh is the avoided energy.
- As a percentage of the adjusted baseline: 60.2 ÷ 525.5 = 11.5 %, half the naive figure.
Data set B with the baseline of Application 1 (RMSE 27.30 kWh). Days 365 to 499 are the check period, when nothing changed; from day 500 the reporting period runs. In the lower panel the band is the expanded uncertainty U = 2 × RMSE × √m, as a percentage of the summed baseline. In the check period the error should stay inside its band. After the measure the saving is real once its whole band is above zero.
Check yourself
Three questions. Each wrong choice is a mistake people really make, so read the note after you answer.
1. A baseline has an RMSE of 20 kWh a day. Over the first 100 days after a measure, the avoided energy is 300 kWh. What do you report?
2. Over 230 days the adjusted baseline is 120,871 kWh, the meter shows 107,014 kWh, and the avoided energy is 13,857 kWh. Before the measure the building used 602.3 kWh a day. What percentage saving do you report?
3. With this building's baseline (RMSE 27.30 kWh, about 525.5 kWh a day), a saving of 1 percent needs 108 days to be seen. How many days does a saving of 2 percent need?
Discussion
No comments yet. Questions, results from your own build, a better way to explain it: all welcome.
My notes on this page
Kept on this device only. Nothing is sent anywhere.
Tip: select words in the lesson, or tap a figure or an equation, to put a note right there.
Notes on earlier wording
The lesson has changed and these words are no longer in it. Your notes are kept, with the words you chose.