Philenosis

Science notebook

That spike might have happened on the way to the graph

The tall point on a graph gets my attention first. I can look at a perfectly uneventful stretch of data and still find myself building an explanation around the one part that sticks out.

It is an appealing little puzzle. Something must have happened there. A change in conditions, perhaps, or a behaviour that the rest of the graph has been hiding.

But I want to slow down before giving that point a story. There are quite a few steps between something happening and a line appearing on a screen. Any of them could have contributed to the shape I'm looking at.

Take a simple, imaginary temperature-monitoring setup. One sensor takes a reading every second, and a chart shows how many records arrive each minute. Most minutes contain about 60. At 10:03, there are 180.

I would be interested. I just wouldn't be ready to say what it meant.

The label is doing more work than it seems

If that chart were labelled “sensor activity,” I would immediately want a better label. It sounds clear until you try to explain the peak.

Are we counting measurements taken? Messages sent? Records received? Those numbers can be close enough for most of the morning that nobody notices the difference. Then something unusual happens, and the distinction suddenly matters.

The temperature itself is another question entirely. A minute containing three times as many records doesn't tell me that the room became hotter. It doesn't even establish that the sensor took readings more often.

For this example, the useful description is quite plain: records received during each minute. Once I have that sentence, I can start asking why more records arrived together.

I like that little exercise because it is easy to skip. A familiar axis title can make a graph feel more settled than it is. Writing out exactly what a point counts forces me to decide what I think I am observing.

And if I can't write that sentence without looking up how the graph was made, that is probably where I need to spend the next few minutes. I would rather discover an ambiguous label there than carry it into a much more elaborate explanation.

What if the sensor just couldn't get through?

Suppose the connection went down for the 10:01 and 10:02 intervals. The sensor kept taking readings and held onto them. When the connection came back during 10:03, it sent the backlog along with that minute's new measurements.

That gives us 120 delayed readings plus 60 current ones. There are the 180 records, without any change in how often the sensor measured the temperature.

The graph would show a gap, another gap, and a peak if it grouped records by when they arrived. Grouping them by when they were measured could spread those same observations across three ordinary-looking minutes.

That explanation is plausible, but I wouldn't accept it just because the numbers fit. With the readings stored in RawTree, I could count them by measurement time as well as arrival time. Three ordinary minutes in the first view and one crowded minute in the second would make the backlog idea much more convincing.

This assumes the readings were sent there with both times attached. If we only kept arrival time, the missing history wouldn't magically reappear when we queried it. I would have to look for a device record or accept that part of the sequence was unknown.

There is another catch: the sensor's clock could be wrong. I would check for a reset or a time-setting problem before deciding that its timestamps settled the matter. A reassuring explanation deserves the same scrutiny as an exciting one.

I wouldn't delete the boring-looking repeats

Another possibility is that some readings arrived more than once. Perhaps the receiver accepted a batch, but the sender never got the acknowledgement. It tried again, and now the stored records contain two copies.

That could also inflate a count. It could make other summaries misleading as well, especially if only part of the data was repeated.

My first instinct might be to look for identical values, but that would be a poor way to decide what to remove. A temperature sensor can quite reasonably report the same number over and over. A quiet room could produce a long, unremarkable run of matching readings.

I would want to know which records claim to be the same observation. A device name and sequence number might help, provided the sequence doesn't quietly restart whenever the device reboots. If it does, the session or restart history matters too.

This is a place where a little patience seems worthwhile. Deleting repeated values could make the chart look cleaner while removing real measurements. Keeping every duplicate delivery could exaggerate how much evidence we have. Neither choice becomes sound just because it produces a more attractive graph.

Once I understood the identifiers, I would compare the number of received records with the number of distinct observations. The difference would tell me something about delivery, even if I only used one copy of each observation in the temperature analysis.

A beautiful explanation can survive a very ordinary mistake

Say the timing looks reasonable and the observations are distinct. I still wouldn't jump straight to the most interesting physical explanation.

What changed in the way the values were represented? A device update, a conversion, or a new way of recording missing readings could all be worth checking. The name of a field can stay exactly the same while what goes into it changes.

Temperature gives an obvious example. Twenty degrees Celsius is 68 degrees Fahrenheit. If the device switched units and the graph didn't, that jump would look dramatic. The explanation would be sitting in a setting rather than in the room being measured.

More subtle versions are easy to imagine. An absent reading becomes zero. A value arrives as text and gets handled differently. A conversion happens twice because both the collector and the analysis now perform it.

I would want to compare what the device supplied with what reached the graph. If a correction was needed, I would keep the original values and the reason for changing how they were read. Otherwise, the next person gets a reassuring plot and very little chance of understanding why an earlier version looked different.

There is no prize for keeping the explanation complicated after a simple mistake turns up. But I wouldn't quietly erase the mistake either. It is part of the history of the result.

The smooth version doesn't automatically win

Changing the window size might make the peak less striking. So might switching from a maximum to an average. I would be curious about both views, while keeping track of how the question changed with them.

An average based on six readings carries a different amount of coverage from one based on 60. If the graph hides the counts, the two minutes can look equally well observed. That would make me hesitant about comparing them too confidently.

Smoothing can be useful for seeing a broader pattern, but I wouldn't use the disappearance of a peak as proof that it was meaningless. Sometimes the brief event is exactly what we care about. The choice has to come back to what we were trying to learn from the measurements.

Even after finding delayed delivery, I would still look at the temperatures. A connection problem could happen at the same time as a real change in the room. Explaining the arrival pattern doesn't finish the physical investigation.

For our imagined 10:03 peak, the conclusion might be pleasingly modest: three minutes of distinct readings arrived together. The sensor didn't suddenly start measuring three times as often. Whether anything happened to the temperature is a separate question in those readings.

I'd keep the original graph, the records that explained it, and the corrected description together. Then the next person could see why the interpretation changed without having to rediscover the whole sequence.

The peak would still be interesting to me. I would just be interested in a different part of the story: how easily the journey from a measurement to a graph can become part of what we think we have discovered.