Difference in Graph and Map Marker Data

Overview

While using the PurpleAir map, you may notice that the values on the graph do not match those on the Map Markers. Data shown on the graph always uses a true average. However, map markers will show either real-time or pseudo-averaged data.

Note: This only applies to averaged PurpleAir data. Real-time data will always match on both the graph and the Map Markers.

What Data is Shown on Map Markers

The following data layers will show pseudo-averaged data on map markers:

  • US EPA PM2.5 AQI
  • Raw PM2.5

If a conversion is selected with either of these data layers, the conversion will also be applied to pseudo-averaged map marker data (with the exception of the ALT cf=3 conversion. This conversion causes real-time data to be shown).

All other data layers will only show the latest real-time data on the map markers, regardless of the averaging period selected.

What are Pseudo Averages and True Averages?

The true average, or simple average, refers to using the mean. This is what most people typically think of as an average.

The pseudo averages are weighted moving averages. This means that instead of re-calculating the simple average using all data points for the averaging period, the pseudo average is updated with just the latest data point using the formula below.


How is The Pseudo Average Calculated?

First, we subtract the current pseudo-average value divided by the average’s length in minutes.

Then, we add the latest real-time data value divided by the average’s length in minutes.

The formula, in code, is as follows:

pseudo_avg -= pseudo_avg / pseudo_avg_minutes
pseudo_avg += new_entry / pseudo_avg_minutes

Key Terms:

  • “pseudo_avg” is the current pseudo average value
  • “pseudo_avg_minutes” is the pseudo average’s length in minutes. For the daily average this would be 1440.
  • “new_entry” is the latest real-time data the device has reported.

 
This formula results in an estimation of what the true average is. While it is only an approximation, it is much less server intensive to compute than calculating the simple average for every sensor on the map. This approximation will trend toward the true average, but is never able to reach it.


Our Plans

We are working to synchronize the values in the future. The Map Markers will display true averages instead of the weighted moving averages they currently display.

1 Like