# Discrepancy between current value on dot and in graph

**URL:** <https://community.purpleair.com/t/discrepancy-between-current-value-on-dot-and-in-graph/2314>\
**Category:** Real-Time Map\
**Created:** [October 9, 2022, 4:08pm UTC](https://community.purpleair.com/t/discrepancy-between-current-value-on-dot-and-in-graph/2314 "2022-10-09T16:08:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![whiwal](https://avatars.discourse-cdn.com/v4/letter/w/54ee81/32.png) [@whiwal](https://community.purpleair.com/u/whiwal)\
**Post date:** [October 9, 2022, 4:08pm UTC](https://community.purpleair.com/t/discrepancy-between-current-value-on-dot-and-in-graph/2314/1 "2022-10-09T16:08:09Z")

</div>

Hi,

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](https://us1.discourse-cdn.com/flex020/uploads/purpleair/original/2X/7/70958ea81550fe32811705bdad5ff16df093d985.png)

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

 ![Newhalem conversion none](https://us1.discourse-cdn.com/flex020/uploads/purpleair/original/2X/4/4674d3d8726fb26901eef18c7b363fc161ede9d3.png)

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?

Thanks,  
Wallace

---

<div class="post-metadata">

**Author:** ![Ethan](https://sea2.discourse-cdn.com/flex020/user_avatar/community.purpleair.com/ethan/32/177_2.png) [@Ethan](https://community.purpleair.com/u/Ethan)\
**Post date:** [October 10, 2022, 9:02pm UTC](https://community.purpleair.com/t/discrepancy-between-current-value-on-dot-and-in-graph/2314/2 "2022-10-10T21:02:11Z")

</div>

Hi @whiwal, we have just posted a new topic regarding this issue. You can find it here: [Difference in Graph and Marker Data](https://community.purpleair.com/t/difference-in-graph-and-marker-data/2262).

---

<div class="post-metadata">

**Author:** ![whiwal](https://avatars.discourse-cdn.com/v4/letter/w/54ee81/32.png) [@whiwal](https://community.purpleair.com/u/whiwal)\
**Post date:** [October 10, 2022, 10:10pm UTC](https://community.purpleair.com/t/discrepancy-between-current-value-on-dot-and-in-graph/2314/3 "2022-10-10T22:10:54Z")

</div>

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. 🙂

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?

---

<div class="post-metadata">

**Author:** ![pbhuss](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@pbhuss](https://community.purpleair.com/u/pbhuss)\
**Post date:** [October 15, 2022, 10:17pm UTC](https://community.purpleair.com/t/discrepancy-between-current-value-on-dot-and-in-graph/2314/4 "2022-10-15T22:17:29Z")

</div>

@Ethan 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.

---

<div class="post-metadata">

**Author:** ![Ethan](https://sea2.discourse-cdn.com/flex020/user_avatar/community.purpleair.com/ethan/32/177_2.png) [@Ethan](https://community.purpleair.com/u/Ethan)\
**Post date:** [October 20, 2022, 6:56pm UTC](https://community.purpleair.com/t/discrepancy-between-current-value-on-dot-and-in-graph/2314/5 "2022-10-20T18:56:42Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![whiwal](https://avatars.discourse-cdn.com/v4/letter/w/54ee81/32.png) [@whiwal](https://community.purpleair.com/u/whiwal)\
**Post date:** [October 20, 2022, 9:40pm UTC](https://community.purpleair.com/t/discrepancy-between-current-value-on-dot-and-in-graph/2314/6 "2022-10-20T21:40:20Z")

</div>

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

> [@Values shown on map don't match the sensor time series when EPA conversion is applied](https://community.purpleair.com/t/values-shown-on-map-dont-match-the-sensor-time-series-when-epa-conversion-is-applied/2405/3):
>
> Found the bug, in the class definition for the US EPA conversion (in the Modern map code, file pa.map.2.0.11-SNAPSHOT.modern.js): getGraphValueFromData(t, e, i, r) { return 'inside' == e.location\_type ? this.calculate\_cf(t[this.getDataHeaderIndex('pm2.5\_cf\_1\_' + i)], t[this.getDataHeaderIndex('humidity\_a')]) : this.calculate\_cf(t[this.getDataHeaderIndex('pm2.5\_atm\_' + i)], t[this.getDataHeaderIndex('humidity\_a')]) } That second half of the conditional, used for outside sens…
