epidemics / covid

epidemicforcasting.org visualization repository
http://epidemicforecasting.org
GNU Affero General Public License v3.0
20 stars 12 forks source link

Add initial_infected_per_1000 to data #118

Closed gavento closed 4 years ago

gavento commented 4 years ago

The negative infected numbers we saw in line data do make sense, since the countries should not start at 0 infected but at the number we set them to be in the simulation. Heavily pre-infected countries like Iran then quickly get into negative. Not sure how to get this data in the fastest way, though - they are not a part of the GV export not HDF5.

gavento commented 4 years ago

Quick hack: assume that the country has (close to) 0 infected at some point, take -minimum as the initial value. (Tested for Iran on currently live data and matches well.) See: https://github.com/epidemics/covid/blob/data_pipeline/data-prep/process_data_hdf.py#L29

wolverdude commented 4 years ago

What's the status on this? Is it being handled on the data end or the d3 end?

hnykda commented 4 years ago

@gavento Do you think it makes sense to add it to the lines data (in the pipeline), e.g. extending the notion spec to:

"data": {"infected_per_1000": {
  "start": "DATE",
  "initial_infection_count": 343,  # <- already per_1000 so it's the same scale
  "mitigation_to_parameter_mapping": { 
        "Weak seasonality, small air traffic restrictions": {"beta": 0.5, "alpha": 0.3},
        "Medium seasonality, small air traffic restrictions": {"beta": 0.7, "alpha": 0.3}
    ...
  }
  "mitigations": {
    "None": {
      "Weak seasonality, small air traffic restrictions": [2.3, 3.4, 5.6, ...],
      "Medium seasonality, small air traffic restrictions": [2.2, 3.1, 4.2, ...],
      ...}
    "Weak": { ... },
    "Medium": { ... },
    "Strong": { ... },
  }}}

That would then be enough to set as a start of yaxis, right @wolverdude ?

gavento commented 4 years ago
gavento commented 4 years ago

I mean to have it in this data section (it should be FT_Infected):

"data": {"estimates": {
  "days": {
    "2020-03-16": {
    "JH_Deaths": 21,
    "JH_Confirmed": 354, ## These are all confirmed cases, including dead and recovered
    "JH_Recovered": 63,
    "JH_Infected": 270,  ## This is the number of currently infected
    "FT_Infected": 2138,    ## Mean estimate
    "FT_Infected_q05": 453, ## lower 90% confidence interval (0.05 quantile)
    "FT_Infected_q95": 6435 ## upper 90% confidence interval (0.95 quantile)
      },
    "2020-03-17": { ... },
gavento commented 4 years ago

Would be resolved easily with #232

gavento commented 4 years ago

Partially resolved by https://github.com/epidemics/epifor/pull/10 - now just needs normalization by population (to match units)

gavento commented 4 years ago

(Just to be clear: I think that anyone can do it when they have time, we have reliable populations for all countries and most cities except the small / strange ones.)

gavento commented 4 years ago

Closing, the quantity can be easily computed in JS by dividing the two. (As is already done in the case-map?)