Giter Club home page Giter Club logo

covid_exposure's Introduction

covid_exposure

This repository contains R code that compares the number of diagnosis keys downloaded by Scotland's COVID-19 exposure notification app to the number of daily COVID-19 cases. The number of downloaded keys is extracted from files exported via the iPhone "Exposure Notifications" settings pane, and the number of new daily COIVD cases come from Public Health Scotland's Open Data portal.

Background

My rough understanding (and I'm very happy to be corrected here!) is that Bluetooth data is exchanged by passing devices using a "rolling proximity identifier" (which changes ~15 minutes) which is coupled with a "temporary exposure key" (which changes daily). If a user self-reports as a positive case, the (~14) most recent temporary exposure keys are bundled as a single "diagnosis key" and uploaded to a central (NHS) server. New diagnosis keys are periodically downloaded by individual user's phones; and each phone then checks whether the identifiers it has collected from other phones in its vicinity match any of these diagnosis keys (and issues a self-isolation warning if so).

Some useful links that outline this are:

Exposure Notification Export Files

Both iPhone and Android OSs allow users to export metadata files related to recently downloaded diagnosis keys. Note, this is not the keys themselves, but simply a note of the number of keys downloaded, a time-stamp of when they were downloaded, and the number that match with those already recorded by the user's phone. This "match count" will be zero if the user's phone has not been in the vicinity of someone who later self-reported as a positive case. (However, it's not clear to me if a non-zero match count indicates any level of proximity, or if it indicates proximity significant enough for the user to be alerted e.g. <2m for 15m)

So, the number of new keys downloaded by the app refers to the number of cases who have self-reported their positive test via the app, and as such it could be interesting to compare this to the reported number of new cases. This might give some insight as to how widely used the app is: if the number of new cases is the same as the number of new downloaded keys, it implies everybody who knows they're positive has self-reported using the app.

Caveats etc

  • Note there will likely be different time lags involved (people might not immediately self-report, and the new cases data is reported by the date the test was performed), and a lack of completeness in the most recent time periods.

  • My iPhone typically polls the server to download new keys 2 - 4 times a day, so the plots below are aggregated to daily level for ease of comparison to the daily "new cases" data. Other phones may download larger batches of new keys but do see less often, in which case aggregating to daily level may cause intermittent blank periods etc.

  • Exposure notification files generated by different phones / operating systems may have different filenames and structures. The code here is written with iPhone output files in mind (because that's what I have to hand). There is an option to use files exported from an Android device, but this has only been tested sparingly! However, the files are not complex, so the code should be easy enough to adapt.

New Daily Cases / Keys

Here we can see the daily number of downloaded keys compared to the daily COVID-19 cases. It's early days yet but it looks like the reported cases correlates well with the daily number of keys, although ideally more data and some more significant "features" would be needed to realistically asses any phase lag.

Cumulative Cases / Keys Since September 17th

To compare the cumulative number of new cases to the cumulative number of new keys, we'll start from September 17th. This was the date the app reached one million downloads, which seems like as good a milestone as any. We can see that more than 60% of the new cases have been registered via the app since then.

Comparisons Between Phones

As phones should all be downloading the same set/s of diagnosis keys, the information in two phones' exposure notification files should be essentially identical in terms of total keys downloaded, and differ only in terms of polling frequency and number of keys downloaded each time.

Here we can see numbers of keys downloaded over time for two separate phones (whose exposure notification files were exported within a few minutes of each other). One phone polls frequently and downloads (relatively) fewer keys each time, whereas the other phone polls infrequently and downloads more keys at once.

Looking at this cumulatively exposes the issue -- the owner of phone 2 spends days at a time without downloading new keys. At the time these data files were exported the owner of phone 2 recently had less than half the number of keys downloaded compared to phone 1 (and would not be notified of an exposure match until they had downloaded a relevant key), but then suddenly caught up by dowloading over 2,500 keys at once.

Conclusion

Cautious optimism! It looks like a significant proportion of known cases are self-reporting via the app, which can only be a help to the general contact tracing efforts. The disparity in polling frequencies between devices may warrant further investigation!

covid_exposure's People

Contributors

jakeybob avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.