Skip to contents

Using DuckDB from a parquet file. The function expects the file to be in SCD2 format with column names:

  • parameter

  • geo_value

  • disease

  • start_date

  • end_date

  • value

Usage

read_interval_pmf(
  path,
  disease = c("COVID-19", "Influenza", "test"),
  as_of_date,
  parameter = c("generation_interval", "delay", "right_truncation"),
  group = NA
)

Arguments

path

A path to a local file

disease

One of "COVID-19" or "Influenza"

as_of_date

The parameters "as of" the date of the model run

parameter

One of "generation interval", "delay", or "right-truncation

group

An optional parameter to subset the query to a parameter with a particular two-letter state abbrevation. Right now, the only parameter with state-specific estimates is right-truncation.

Value

A PMF vector

Details

start_date and end_date specify the date range for which the value was used. end_date may be NULL (e.g. for the current value used in production). value must contain a pmf vector whose values are all positive and sum to 1. all other fields must be consistent with the specifications of the function arguments describe below, which are used to query from the .parquet file.

SCD2 format is shorthand for slowly changing dimension type 2. This format is normalized to track change over time: https://en.wikipedia.org/wiki/Slowly_changing_dimension#Type_2:_add_new_row