Discrepancy between current value on dot and in graph


I’m very glad to have the detailed real-time and recent data of PurpleAir. I’m confused, though, by the differences I’ve noticed between the value shown in the map dot and the latest value in the graph over time. I expect them to be the same, but often they are not, by a large margin. Example:

Newhalem conversion EPA

As you can see above, I’m using the US EPA conversion. If I reset the conversion to None, the values do match:

The US EPA conversion does affect both values, but not in the same way, strangely. Is this a bug or am I misunderstanding the design?


1 Like

Hi @whiwal, we have just posted a new topic regarding this issue. You can find it here: Difference in Graph and Marker Data.

Thanks very much, Ethan. That’s interesting.

In signal processing (where I’m rusty), I believe “infinite impulse response (IIR) filter” is a better name for the method that is described on your linked page as a “weighted moving average.” The code shown matches an IIR, but the description is inaccurate in that the oldest entry is never deleted. All old entries slowly decay, having less and less effect the older they are, just like in classic analog filters using resistors and capacitors.

And a true moving average of, say, the last 10 minutes is called a “finite impulse response (FIR) filter.”

Either can be useful, and unintentionally comparing the two can be confusing. :slight_smile:

But while PurpleAir may indeed be using the two, that alone wouldn’t explain the discrepancy I noted earlier in the 10-minute-averaged (or -filtered) values, nor would it explain the substantial effect of the conversion setting on this comparison. Maybe there’s a discrepancy about where in the pipeline the conversion is applied?

@Ethan_Breinholt the post you linked does not explain the discrepancy with the US EPA conversion. If you look at the first screenshot in @whiwal’s post, the Map Marker shows the “Now” AQI as 282, whereas in the graph you can clearly see the AQI has never exceeded 250 (and is generally below 200).

I’m noticing discrepancies between Map Markers and the graph specifically when using US EPA conversion across all sensors, even when “real-time” is selected for the averaging period. The Map Markers seem to have inflated readings compared to the graph across the board.

1 Like

@pbhuss, since two different averages are being used, you may not be able to compare the reading on the map marker to the readings in the graph. If a graph was made of the weighted moving average values, the spikes in the graph might jump up much higher than 250. As you can see in @whiwal’s first screenshot, the real-time values are 282 on the map marker and around 190 in the graph. This same discrepancy could have occurred with the large spikes that appeared around 12:00 on October 8 in the graph.

The graph is also displaying a 10-minute average. This means that larger spikes could have occurred that do not appear due to them being averaged.

Lastly, the points used in the weighted moving average may extend past the length of the graph. Higher points in the past may influence the current readings.

@Ethan_Breinholt, please take a look at the deeper discussion of this same problem in another thread: