Skip to content
You Start with one site
Amounts in Start with one site
Control, Measurement & Energy · Course

How Sure Is an Average?

Lesson 3 of 10 24 min read
Found this useful?

A report says the cold room held 4.013 °C and that a new door seal lowered the mean by 0.03 °C. Is 0.03 °C a real change or only chance? A report that cannot answer has proved nothing. Logging software often prints a very small range beside a mean because it counts every one-minute reading as separate evidence, but readings one minute apart mostly repeat each other. This lesson shows how to put a range on an average that you can defend in front of a customer, an auditor or your own manager. #EngineeringStatistics #ConfidenceInterval #Autocorrelation

Learning Objectives

By the end of this lesson, you will be able to:

  1. Calculate the standard error of a mean and a 95 percent confidence interval, with the correct value for a small sample
  2. Explain in plain words what a confidence interval says and what it does not say
  3. Measure the lag-1 autocorrelation of a logged signal and estimate its effective sample size
  4. Use block means, such as daily means, to get an interval from readings that are not independent
  5. Estimate how many days of data are needed to state a mean within a chosen percentage

Real-World System Problem: The mean temperature of a cold room



A cold room for vaccines and dairy products is set to 4 °C. Its thermostat starts the compressor at 5 °C and stops it at 3 °C, so the air temperature rises and falls all day in a saw-tooth pattern. A probe in the return air sends one reading a minute to a logger. After 14 days the logger holds 20,160 readings, and their mean is 4.013 °C.

The site manager wants one line for the quality file: the mean temperature and how sure we are of it. It matters because the next step is a comparison: if the mean after a repair is 3.98 °C, the repair changed something only if the two means differ by more than their uncertainty.

The spreadsheet answer is 4.013 ± 0.009 °C. The probe has a random noise of 0.05 °C and is usually accurate to about ± 0.5 °C, so a range of ± 0.009 °C must be examined before anyone signs it.

Logger1 perminute20,160readingsin 14 daysCold roomprobe in thereturn airmean = 4.013 °C ± ?
From the probe to one number

Fundamental Theory: The uncertainty of a mean



A mean from a sample is an estimate

The 14 days in the logger are a sample. The manager cares about the long-run mean of the room: the value a very long record would give with the same equipment, use and weather. Another 14 days would give a slightly different sample mean. The uncertainty of an average answers one question: by how much do such sample means differ from each other?

This course writes for the number of readings, for the sample mean and for the sample standard deviation, which divides by .

The standard error

The standard deviation describes how far single readings lie from the mean. The mean of many readings moves much less than one reading does, because high and low readings cancel. For independent readings the spread of the mean is the standard error.

Standard error of the mean (independent readings)

Here is the sample standard deviation and is the number of independent readings.

Take 25 spot checks of a room with a hand thermometer, on 25 different days, with . The standard error is . The square root is a strict rule: to halve the standard error you need four times as many readings, and to divide it by ten you need one hundred times as many.

The confidence interval and the t value

A standard error becomes a range when it is multiplied by a factor that fixes how often the range is right.

Confidence interval of a mean

For 95 percent confidence and a large sample, . For a small sample, is larger and is read from the distribution with degrees of freedom.

The factor is larger for a small sample because itself is then poorly known, and the interval must allow for that.

Readings Degrees of freedom for 95 percent
324.303
542.776
762.447
1092.262
14132.160
25242.064
very manyvery many1.960

For the 25 spot checks, the interval is . The common mistake is to use 1.96 for every sample. With 5 readings that makes the interval 29 percent too narrow.

What a 95 percent confidence interval means

The 95 percent describes the method, not one result. Repeat the whole measurement many times, each with a new 14 days and the same rule, and about 95 of every 100 intervals contain the true long-run mean. The other 5 miss it, and nothing in the data tells you which ones. What the interval does not mean:

  • It does not say that 95 percent of the readings lie inside it. The room moves between 3 °C and 5 °C all day, while the interval of its mean is a few hundredths of a degree wide. Single readings are described by and by percentiles.
  • It does not include the error of the sensor. If the probe reads 0.4 °C high, every reading is 0.4 °C high, and the mean is 0.4 °C high with a very narrow interval. Averaging removes random scatter. It does not remove an offset. Calibration is the only cure.
  • It does not promise anything about next month. If the door seal fails or the season changes, the long-run mean itself moves.
  • It does not say where the next value will fall. That needs a prediction interval, , which is always wider. A claim about the long-run mean needs the confidence interval; a claim about one future day, one bill or one reading needs the prediction interval.
  • It is only correct if the rule behind it fits the data. The rule above assumes independent readings.

Why readings one minute apart are not independent

If the room is at 4.6 °C now, it will be very near 4.6 °C one minute from now, so the second reading adds almost no new information about the mean. It is like asking one person the same question every minute: you hear the same answer sixty times, not sixty opinions.

5 °C●●●●●●●●●●●●●●●●●●●●●●●●●●●●3 °Cone cycle, about 27 mineach ● is close to the ● before it
Neighbouring readings repeat each other

A signal whose values resemble its own recent past is called autocorrelated. Almost all sensor data is autocorrelated, because physical things have inertia: air, water and metal cannot change temperature in an instant.

Lag-1 autocorrelation

The lag-1 autocorrelation measures how strongly each reading resembles the one before it.

A value near 0 means that neighbouring readings are unrelated. A value near 1 means that each reading almost repeats the last. The cold room data gives . The same sum with the readings steps apart gives the autocorrelation at lag .

Effective sample size

A simple model of a signal with memory says that the autocorrelation falls by the same factor at every step: at lag 1, at lag 2, and so on. Statisticians call it the AR(1) model. For such a signal, correlated readings carry as much information about the mean as a smaller number of independent readings.

Effective sample size (AR(1)-like signal)

With the ratio is , so 5,000 readings are worth only 128. In 2,000 trials on computer-made signals of this kind with a known mean, the naive interval contained the true mean in only 24.8 percent, and the interval with in 94.9 percent. The naive rule printed “95 percent” and was wrong three times out of four.

Block means: the practical cure

This method needs no model of the signal. Cut the record into blocks longer than the longest pattern in the data, take the mean of each block, and treat the block means as the readings. If the blocks are long enough, their means are close to independent and the simple rule with the value applies.

...day 141,440day 31,440day 21,440day 11,440minute readings (correlated)4.0554.0374.015...4.02414 daily means (close to independent)
Block means: one value for each day

For most sites the natural block is one day, because working hours, door use and weather all repeat daily. Where weekdays differ from weekends, the natural block is one week. The price is a small number of blocks, so the value matters: 14 daily means have 13 degrees of freedom and .

How many readings are needed

Reverse the interval. If the mean must be known within a fraction of itself at 95 percent confidence, then , which gives

The answer counts independent readings. It rises with the square of the scatter and with the square of the precision that is asked for. Application 2 uses it and shows where it misleads.

Application 1: The mean temperature of the cold room



Step 1: The naive interval

Click to reveal the naive calculation
  1. Standard error with all readings counted.

    The standard error is 0.00437 °C. ✅

  2. Interval. The sample is large, so .

    The naive interval is . ✅

  3. Test the assumption. This result assumes 20,160 independent readings. With each reading almost repeats the one before it, so the assumption is false and the result cannot be trusted on its own. ✅

Step 2: The effective sample size

Click to reveal the corrected calculation
  1. Effective sample size.

    By this formula the 20,160 readings are worth about 506 independent ones. ✅

  2. Standard error.

    The standard error is 6.3 times the naive value. ✅

  3. Interval.

    With the effective sample size the interval is . ✅

Step 3: The interval from 14 daily means

Click to reveal the block mean calculation
  1. Mean of the daily means. The days are equal in length, so the mean of the 14 daily means is the mean of all readings: 4.0128 °C. ✅

  2. Standard error of the 14-day mean.

    The day-to-day scatter gives a standard error of 0.00432 °C. ✅

  3. The t value. There are 14 values, so 13 degrees of freedom and . ✅

  4. Interval.

    From the daily means the interval is , or 4.003 to 4.022 °C. ✅

Step 4: Compare the three and check

Click to reveal the comparison
  1. Put the three in one table.

    MethodReadings counted95 percent interval
    Naive, all readings20,160± 0.0086 °C
    Effective sample size506± 0.054 °C
    Daily means, 14± 0.0093 °C

    The three methods do not agree, and the corrected formula is the one that differs. ✅

  2. Why the formula is too wide here. The formula assumes that the autocorrelation fades steadily: 0.951, then , and so on, always positive. The script shows that the cold room signal does not behave that way. At a lag of 5 minutes the autocorrelation is , at 10 minutes it is , and at 27 minutes, one full cycle, it is . The readings of the cooling half of a cycle cancel those of the warming half, so every complete cycle has nearly the same mean. The formula cannot see that cancellation. ✅

  3. Why the naive interval is close by accident. The naive rule reasons wrongly, and for this signal two errors nearly cancel: neighbouring readings repeat each other, and readings half a cycle apart oppose each other. A drifting signal has only the first effect, and there the naive interval was right in 24.8 percent of trials. Do not rely on a cancellation you have not checked. ✅

  4. Which to report. The daily means make no assumption about the shape of the signal inside a day. They only need one day to be nearly independent of the next. Report (95 percent, from 14 daily means), and say that this covers random variation only. ✅

  5. Check with the script. The Python script below prints 0.0086, 0.0540 and 0.0093 °C for the three intervals, with from scipy. It also reports an autocorrelation of 0.46 between each daily mean and the next. From 14 values that number is very uncertain, but it warns that the days may not be fully independent, so ± 0.009 °C is better treated as the smallest honest interval. ✅

  6. The next day, not the mean. The next daily mean of this room is expected within . This prediction interval is four times wider than the confidence interval, because one day scatters more than a mean of 14 days. ✅

Step 5: Check it on two halves of the same record

Click to reveal the check on a record where nothing changed
  1. Split the record. Nothing was changed in the room during the 14 days, so the true difference between the first and the second week is zero. Week 1 has a mean of 4.017 °C (, ). Week 2 has 4.008 °C (, ). The difference is 0.009 °C. ✅

  2. Interval of a difference. The standard errors of two independent means combine as a square root of the sum of squares.

    With (7.7 degrees of freedom by Welch’s rule, which scipy.stats.ttest_ind(a, b, equal_var=False) uses) the interval is . The difference of 0.009 °C is inside it, so the method does not report a change that did not happen. ✅

  3. What it means. Repeat this split on other quiet periods. If a quiet record often shows a “real” change, the interval is too narrow, usually because the blocks are too short. For the repair in the opening, two 14 day means of each give a difference interval of , so a fall of 0.033 °C (4.013 to 3.98 °C) is larger than chance. Compare the difference with its own interval: two intervals that overlap a little can still show a real difference. ✅

Application 2: How many days of energy data are enough?



Step 1: The scatter of daily energy

Click to reveal the scatter
  1. Scatter as a fraction of the mean.

    One day differs from the mean by about 27 percent on a typical day. ✅

  2. The target. Three percent of the mean is kWh. The interval of the mean must be no wider than ± 17.3 kWh. ✅

Step 2: The number of days from the formula

Click to reveal the number of days
  1. Apply the formula.

    The formula asks for 309 days, rounding up. ✅

  2. Check by going forward. With 309 days, kWh, which is 3.00 percent of the mean. The arithmetic is consistent. ✅

Step 3: Test the answer against the data

Click to reveal the test
  1. Use the first 309 days. Their mean is 596.8 kWh. The mean of the full year is 575.8 kWh. The difference is +3.6 percent, outside the ± 3 percent that the formula promised. ✅

  2. Find the reason: the days are not independent. The lag-1 autocorrelation of daily energy is 0.66, and at a lag of 7 days it is 0.82. Each day resembles the day before and, more strongly, the same day of the week before. The formula counted 309 independent days and they are not. ✅

  3. Find the cause of the dependence. The mean of 30 days starting at day 0 is 557 kWh. Starting at days 90, 180 and 270 it is 733, 577 and 444 kWh. The energy follows the season. Weekdays have a mean of 629.5 kWh and weekend days 440.9 kWh. Most of the 154.7 kWh of scatter is not random noise. It is the weather and the calendar. ✅

  4. Conclusion. A stretch of 309 days in a row leaves out 56 days of one season, so its mean is pulled toward the seasons it contains. To state the yearly mean of this building, use whole years. To state how sure you are of it, the scatter that matters is what remains after weather and weekday are explained. ✅

Verify It in Python



The script builds data set A and data set B with fixed seeds, so it prints the same numbers on any computer. It calculates the three intervals of Application 1, tests the three methods on 2,000 computer-made drifting signals with a known mean, and calculates the days needed in Application 2. The plot shows the autocorrelation of the cold room readings and the 14 daily means with their interval.

average_uncertainty.py
"""How sure is an average? Cold room minutes (data set A) and daily energy (data set B)."""
import numpy as np
from scipy import stats, signal
import matplotlib.pyplot as plt
def cold_room_minutes(seed=11, days=14):
rng = np.random.default_rng(seed)
n = days * 1440
t = np.empty(n); temp = 4.0; on = False; out = []
for i in range(n):
minute = i % 1440
# door openings are more likely in working hours
door = (480 <= minute < 1020) and (rng.random() < 0.035)
if temp >= 5.0: on = True
if temp <= 3.0: on = False
temp += (-0.30 if on else 0.10) + (0.35 if door else 0.0)
t[i] = temp + rng.normal(0.0, 0.05) # sensor noise, 0.05 °C
return t
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
def autocorr(x, lag):
"""Autocorrelation of x at one lag."""
d = x - x.mean()
return float((d[:-lag] * d[lag:]).sum() / (d * d).sum())
# ---------- Application 1: mean temperature of the cold room ----------
x = cold_room_minutes()
n = x.size
mean, s = x.mean(), x.std(ddof=1)
print("Cold room, one reading a minute")
print(f" n = {n}, mean = {mean:.4f} degC, s = {s:.4f} degC")
se_naive = s / np.sqrt(n)
print(f" naive: SE = {se_naive:.5f}, 95 % interval = +/- {1.96 * se_naive:.4f} degC")
r1 = autocorr(x, 1)
n_eff = n * (1.0 - r1) / (1.0 + r1)
se_eff = s / np.sqrt(n_eff)
print(f" r1 = {r1:.4f}, n_eff = {n_eff:.0f}")
print(f" with n_eff: SE = {se_eff:.5f}, 95 % interval = +/- {1.96 * se_eff:.4f} degC")
print(" autocorrelation at lags 5, 10, 27 min: "
+ ", ".join(f"{autocorr(x, k):+.3f}" for k in (5, 10, 27)))
daily = x.reshape(14, 1440).mean(axis=1)
k = daily.size
s_d = daily.std(ddof=1)
t13 = stats.t.ppf(0.975, k - 1)
half_d = t13 * s_d / np.sqrt(k)
print(" daily means: " + " ".join(f"{v:.3f}" for v in daily))
print(f" 14 daily means: mean = {daily.mean():.4f}, s = {s_d:.4f}, "
f"SE = {s_d / np.sqrt(k):.5f}, t = {t13:.3f}")
print(f" from daily means: 95 % interval = +/- {half_d:.4f} degC "
f"({daily.mean() - half_d:.3f} to {daily.mean() + half_d:.3f})")
print(f" r1 of the daily means = {autocorr(daily, 1):.2f}")
# ---------- A test of the three methods on a signal with no cycle ----------
rng = np.random.default_rng(5)
phi, m, trials = 0.95, 5000, 2000 # true mean is 0
noise = rng.normal(0.0, 1.0, (trials, m + 500))
y = signal.lfilter([1.0], [1.0, -phi], noise, axis=1)[:, 500:]
ybar, ys = y.mean(axis=1), y.std(axis=1, ddof=1)
dev = y - ybar[:, None]
yr1 = (dev[:, :-1] * dev[:, 1:]).sum(axis=1) / (dev * dev).sum(axis=1)
half_naive = 1.96 * ys / np.sqrt(m)
half_eff = 1.96 * ys / np.sqrt(m * (1.0 - yr1) / (1.0 + yr1))
blocks = y.reshape(trials, 20, 250).mean(axis=2)
half_block = stats.t.ppf(0.975, 19) * blocks.std(axis=1, ddof=1) / np.sqrt(20)
print("Drifting signal (r1 = 0.95, no cycle), 2000 trials: intervals that contain the true mean")
for name, half in (("naive", half_naive), ("n_eff", half_eff), ("20 block means", half_block)):
print(f" {name:>14}: {100.0 * (np.abs(ybar) < half).mean():.1f} %")
# ---------- Application 2: days needed for a daily energy mean ----------
d, temp, weekday, energy = building_daily()
e = energy[:365]
e_mean, e_s = e.mean(), e.std(ddof=1)
print("Building, first 365 days of daily energy")
print(f" mean = {e_mean:.1f} kWh, s = {e_s:.1f} kWh, s/mean = {100 * e_s / e_mean:.1f} %")
n_need = (1.96 * e_s / (0.03 * e_mean)) ** 2
n_days = int(np.ceil(n_need))
print(f" days for +/- 3 % at 95 %: {n_need:.1f}, so {n_days} days")
print(f" check: 1.96 s / sqrt({n_days}) = {1.96 * e_s / np.sqrt(n_days):.2f} kWh "
f"= {100 * 1.96 * e_s / np.sqrt(n_days) / e_mean:.2f} % of the mean")
first = e[:n_days].mean()
print(f" mean of the first {n_days} days = {first:.1f} kWh, "
f"{100 * (first / e_mean - 1):+.1f} % from the year's mean")
print(f" r1 of daily energy = {autocorr(e, 1):.2f}, at lag 7 = {autocorr(e, 7):.2f}")
print(" 30-day means from days 0, 90, 180, 270: "
+ ", ".join(f"{e[a:a + 30].mean():.0f}" for a in (0, 90, 180, 270)) + " kWh")
wd = weekday[:365]
print(f" weekdays: mean {e[wd].mean():.1f}, s {e[wd].std(ddof=1):.1f}; "
f"weekend days: mean {e[~wd].mean():.1f}, s {e[~wd].std(ddof=1):.1f} kWh")
# ---------- Plot ----------
fig, ax = plt.subplots(2, 1, figsize=(8, 7))
lags = np.arange(1, 121)
ax[0].plot(lags, [autocorr(x, int(k)) for k in lags], label="cold room readings")
ax[0].plot(lags, r1 ** lags, "--", label="what the n_eff formula assumes")
ax[0].axhline(0.0, color="gray", linewidth=0.8)
ax[0].set_xlabel("lag (minutes)")
ax[0].set_ylabel("autocorrelation")
ax[0].set_title("Readings one minute apart are not independent")
ax[0].legend()
ax[1].plot(np.arange(1, 15), daily, "o-", label="daily mean")
ax[1].axhspan(daily.mean() - half_d, daily.mean() + half_d, alpha=0.25,
label="95 % interval of the 14-day mean")
ax[1].axhline(daily.mean(), color="gray", linewidth=0.8)
ax[1].set_xlabel("day")
ax[1].set_ylabel("mean temperature (degC)")
ax[1].set_title("Fourteen daily means and the interval they give")
ax[1].legend()
fig.tight_layout()
fig.savefig("average_uncertainty.png", dpi=120)
print("Saved average_uncertainty.png")

Expected output

Cold room, one reading a minute
n = 20160, mean = 4.0128 degC, s = 0.6203 degC
naive: SE = 0.00437, 95 % interval = +/- 0.0086 degC
r1 = 0.9510, n_eff = 506
with n_eff: SE = 0.02756, 95 % interval = +/- 0.0540 degC
autocorrelation at lags 5, 10, 27 min: +0.289, -0.562, +0.874
daily means: 4.055 4.037 4.015 4.004 3.997 4.000 4.013 3.997 4.006 4.006 4.011 4.007 4.008 4.024
14 daily means: mean = 4.0128, s = 0.0162, SE = 0.00432, t = 2.160
from daily means: 95 % interval = +/- 0.0093 degC (4.003 to 4.022)
r1 of the daily means = 0.46
Drifting signal (r1 = 0.95, no cycle), 2000 trials: intervals that contain the true mean
naive: 24.8 %
n_eff: 94.9 %
20 block means: 94.0 %
Building, first 365 days of daily energy
mean = 575.8 kWh, s = 154.7 kWh, s/mean = 26.9 %
days for +/- 3 % at 95 %: 308.1, so 309 days
check: 1.96 s / sqrt(309) = 17.25 kWh = 3.00 % of the mean
mean of the first 309 days = 596.8 kWh, +3.6 % from the year's mean
r1 of daily energy = 0.66, at lag 7 = 0.82
30-day means from days 0, 90, 180, 270: 557, 733, 577, 444 kWh
weekdays: mean 629.5, s 130.3; weekend days: mean 440.9, s 126.6 kWh
Saved average_uncertainty.png

On the drifting signal, the effective sample size and the block means contain the true mean close to 95 percent of the time and the naive rule does not. Block means work on both the drifting signal and the cycling cold room, so use them first.

Common Mistakes



  • Dividing by the square root of the number of logged readings when the readings are seconds or minutes apart. Count independent readings, or use block means.
  • Reading a confidence interval as the range of the readings. The interval describes the mean. The readings are described by and by percentiles.
  • Using 1.96 with only a few values. With 14 daily means use , and with 5 use 2.776.
  • Believing that a narrow interval proves the sensor is accurate. An offset in the probe passes through every average unchanged.
  • Applying the days-needed formula to data that follows weather or the calendar. Explain the known causes first, then apply it to the scatter that remains.

Summary



  • A sample mean is an estimate of a long-run mean, and its uncertainty for independent readings is the standard error .
  • A 95 percent confidence interval is . The 95 percent describes how often the method is right. The interval covers random variation only, not sensor offset and not future change.
  • Logged sensor readings are autocorrelated. For a signal that drifts, gives the number of independent readings they are worth. For a signal that cycles, this formula is only a rough guide.
  • Block means, usually daily means, need no model of the signal. The cold room mean is from 14 daily means with .
  • The formula for the number of readings needed counts independent readings. For daily energy driven by season and weekday it gave 309 days, and the mean of those days was 3.6 percent away from the year’s mean.

Exercises



1. A technician measures the air temperature of a store room once a day for 25 days. The mean is 4.20 °C and the standard deviation is 0.60 °C. Find the standard error and the 95 percent confidence interval of the mean. Use .

Answer

. The interval is , so 3.95 to 4.45 °C. Readings a day apart can be treated as independent.

2. Ten daily mean temperatures of a cold room in °C are 4.02, 3.97, 4.05, 4.01, 3.96, 4.04, 3.99, 4.03, 4.00 and 3.98. Find the mean, the standard deviation and the 95 percent confidence interval of the mean. Use .

Answer

The mean is 4.005 °C and . The standard error is and the interval is .

3. A tank temperature that drifts slowly, with no cycle, is logged once a minute for 7 days (). The standard deviation is 0.50 °C and . Find the effective sample size, the naive standard error and the corrected standard error.

Answer

. The naive standard error is and the corrected one is . The corrected value is 3 times the naive value, which is .

4. A pumping station uses a mean of 820 kWh a day with a standard deviation of 95 kWh. Its use does not depend on season or weekday. How many days are needed to state the mean within ± 2 percent at 95 percent confidence? How many for ± 5 percent?

Answer

For ± 2 percent: , so 129 days. For ± 5 percent: , so 21 days.

5. Use only the first 7 daily means of Application 1: 4.055, 4.037, 4.015, 4.004, 3.997, 4.000 and 4.013 °C. Find the 95 percent confidence interval of the mean with . Compare its width with the interval from 14 days.

Answer

The mean is 4.017 °C and . The interval is . It is about twice as wide as the ± 0.009 °C from 14 days. Halving the days alone would widen it by . The rest comes from the larger value and from the larger scatter in this first week.

6. Change the script so that it cuts the cold room record into 336 hourly blocks in place of 14 daily blocks. Find the standard deviation of the hourly means, the standard error of the overall mean, and the lag-1 autocorrelation of the hourly means. Explain why the daily blocks are the safer choice.

Answer

Use x.reshape(336, 60).mean(axis=1). The hourly means have , so , smaller than the 0.0043 °C from daily blocks. Their lag-1 autocorrelation is 0.16, so the hourly means are not independent: door use rises and falls with the working day, and an hour is shorter than that pattern. The hourly result is too narrow. A block must be longer than the longest pattern in the data.

References



  • D. C. Montgomery and G. C. Runger, Applied Statistics and Probability for Engineers, 7th edition, Wiley, 2018.
  • R. J. Hyndman and G. Athanasopoulos, Forecasting: Principles and Practice, 3rd edition, OTexts, 2021. Free at otexts.com/fpp3.
  • G. E. P. Box, G. M. Jenkins, G. C. Reinsel and G. M. Ljung, Time Series Analysis: Forecasting and Control, 5th edition, Wiley, 2015.


© 2021-2026 SiliconWit®. All rights reserved.
Cold room probe in the return air Logger 1 per minute 20,160 readings in 14 days mean = 4.013 °C ± ?
From the probe to one number
minute readings (correlated) day 1 1,440 4.055 day 2 1,440 4.037 day 3 1,440 4.015 day 4 1,440 4.004 day 5 1,440 3.997 day 6 1,440 4.000 day 7 1,440 4.013 day 8 1,440 3.997 day 9 1,440 4.006 day 10 1,440 4.006 day 11 1,440 4.011 day 12 1,440 4.007 day 13 1,440 4.008 day 14 1,440 4.024 14 daily means (close to independent) 3.99 4.00 4.01 4.02 4.03 4.04 4.05 4.06 mean of the 14: 4.013 °C
Block means: one value for each day
Predict first

A tank temperature drifts slowly. A logger stores 5,000 readings, one a minute, and the software prints a 95 percent interval of the mean using all 5,000 readings. Repeat this on many such records. How often does the printed interval contain the true mean?

See it: what 95 percent promises, and when it breaks

Records so far
Intervals that contain the true mean
Typical interval

Each line is the 95 percent interval of the mean from one record of 5,000 readings (about three and a half days at one a minute) of a room whose true long-run mean is 4.00 °C and whose readings scatter with s = 0.60 °C. A coral line misses the true mean. The same records are kept when you change the rule, so you see the rule, not new luck.

the readingsthe probethe mean 3 to 5 °C± 0.5 °C ± 0.009 °C 3 °C4 °C5 °C
Watch it build: readings with memory
≈ 1≈ 1≈ 1 53 04080120 min one reading a minute, °C lag 1: r₁ = 0.951 20,160 readings ≈ 506 4.054.00 day 1day 14 14 daily means, °C 4.013 ± 0.009 °C
  1. Two hours of the cold room, one reading a minute. Each dot lies close to the one before.
  2. Each reading almost repeats the last: over 14 days the lag 1 autocorrelation is 0.951.
  3. By the AR(1) formula, 20,160 readings are worth about 506: one for every 40 minutes.
  4. Cut the record into days: 14 daily means, from 3.997 to 4.055 °C, close to independent.
  5. With t = 2.160 for 13 degrees of freedom, the mean is 4.013 ± 0.009 °C.
every minuteevery day 4.6 °C4.6 °C4.6 °C4.5 °C 4.064.044.024.004.00 60 readings ≈ 1 answer14 days = 14 answers Count independent readings, not logged ones.

Check yourself

Three questions. Each wrong choice is a mistake people really make, so read the note after you answer.

1. Spot checks on 25 different days give a standard deviation of 0.60 °C and a standard error of 0.12 °C. You want a standard error of 0.06 °C. With the same scatter, how many spot checks, on different days, do you need?

2. The quality file says the cold room mean is 4.013 ± 0.009 °C (95 percent, from 14 daily means). Next morning a reading of 4.6 °C appears. What does this reading tell you?

3. Five weekly mean energies of a pump station have a standard deviation of 40 kWh. What is the half-width of the 95 percent interval of their mean?

Found this useful?

Discussion

    Comments show your name. Be kind, stay on the topic.