1 2 3 4 5 6 7 8 9 10 11 12 | covid_abm_v4_debug(
data_inputs,
input_pars,
vax_phases,
visitors,
testing,
vaccination,
verbose,
store_extra,
debug,
output_path
)
|
data_inputs |
List of data inputs for model including, see 'details'. Compiled in '01-Prep-Data-Inputs.R' |
input_pars |
LIST of LISTS containing parameters, dates, functions to support simulation, see 'details'. Compiled in '02-Prep-Par-Inputs.R' |
vax_phases |
list with list describing vaccine phases and their eligibility criteria, see 'details. Compiled in '03-Prep-Vax-Phases.R' |
visitors |
TRUE/FALSE of whether to model outside visitors |
testing |
character in N, S, or A for whether to conduct no testing ("N"), standard testing ("S"), or adaptive ("A") testing |
vaccination |
TRUE/FALSE of whether to model vaccination using inputs in 'input_pars' and 'vax_phases' |
verbose |
TRUE/FALSE should detailed info at each time step be printed? |
store_extra |
TRUE/FALSE should extra metrics including \itemdebugLOGICAL of whether to run in debug mode \itemoutput_pathfile path relative to 'here::here' root to save outputs |
list with two objects: an epi curve with counts of agents in each state through time and a dataframe with infection reports for every new infection (e.g. entry created whenever agent transitions from S to E) Function to run agent based model 'data_inputs' is a list of lists containing 'agents_dt': data.table of agents with necessary characteristics including: "hhsize" "hhincome" "sex" "age" "occp" "race" "hhid" "id" "ct" "essential" "work_ct" "work" "state" "nextstate" "tnext" "t_symptoms" ; 'ct_cdf_list': list of matrices of dim cts x cts in which entries represent probabilities of moving from CT i to CT j on day t where t subsets the list to corresponding day (e.g. ct_cdf_list[[t]] = ct x ct matrix). Used in 'GetCTVisit'/'GetCTVisit_cpp' function ; 'ct_ids' vector relating row numbers of 'ct_cdf_list' to actual ct codes ; 'stay_home_dt' data table with columns 'Date', 'CT', and 'pct_home' (E.g. derived from safegraph data) to use for social distancing/stay at home compliance ; 'visitors_list' list of data frames/tables with columns corresponding to census tract, number of external visitors to that ct, county from which they visited, and population and infection characteristics of that county. column inf_prob represents incidence in that county (new cases identified per population) and is used as probability a visiting agent is infectious along with 'visitor_mult_testing' to correct for ratio of true incidence to incidence from testing data and 'visitor_mult_sfgrph' to correct for ratio of safegraph devices tracked to total population ; 'test_avail' data frame with columns date_num and tests_pp corresponding to number of tests availabe per person on day date_num. Used to generate function returning the number of tests available per agent on day t since test start.
‘input_pars' is a list of lists corresponding to parameters that shouldn’t need to be edited frequently e.g. for model calibration or simulations. It includes a LIST 'trans_pars' containing 'bta_base' baseline transmission probability 'bta_hh' household transmission probability multiplier 'bta_work' work transmission probability multiplier 'bta_sip_red' reduction in transmission probability following SiP to account for microbehaviors such as 6 feet apart, less time indoors, etc.Another LIST 'time_pars' containing: 't0': start date of simulation ; 't.tot' total time to run simulation (in days) ; 'dt' time step (defaults to 4/24, needs editing if otherwise) ; 'day_of_week_fx' function which takes t returns character of day of week (U,M,T,W,R,F,S) ; 'SiP.start' Date that shelter in place started ; 'mask.start' Date that mask mandate was introduced. Another LIST 'init_states' containing : 'E0' number of initial exposed agents ; 'Ip0' number of initial pre-symptomatic infections agents ; 'Ia0' number of initial asymptomatic infectious agents ; 'Im0' number of initial mildy symptomatic agents ; 'Imh0' number of initial mildly symptomatic, will become severely symptomatic agents ; 'Ih0' number of initial hospitalized agents ; 'R0' number of initial recovered agents ; 'D0' number of initial diceased agents. Another LIST 'quar_pars' containing: 'q_prob_contact' probability an agent will quarantine because of known contact with infectious agent ; 'q_prob_resinf' probability an agent will quarantine because of shared residence with infectious agent ; 'q_prob_symptoms' probability an agent will quarantine because of symptoms on a per day basis: e.g. one full day of symptoms = q_prob_symptoms probability of isolating. Note that agents will consider this 4 times per day, so probability should adjust for multiple opportunities ; 'q_prob_testpos' probability an agent will quarantine because of positive test result ; 'q_prob_adapt' probability multiplier agent will quarantine if "exposed" to an adaptive testing site ; 'q_dur_fx' function to generate random quarantine durations ; 'known_contact_prob' proportional increase in probability that a contact with an infectious individual is known. 0 implies known contact occurs at same rate as FOI, implying very low probability that an infectious contact will be known 1 implies probability is double FOI. Since FOIs will be quite small, larger multipliers are suggested. LIST 'test_pars' containing: 'test_start' Date at which testing begins ; 'test_delay_fx' function to generate time delay from test to notification ; 'tests_wknd' percent of weekday tests available on weekends ; 'test_probs_fx' function which returns testing probability for individuals to get tested ; 'cont_mult' multiplier for test probability for agents with suspeceted contact ; 'symp_mult' multiplier for test probability for time exeriencing symptoms; 'res_mult' multiplier for test probability for agents with known infection in their residence ; 'nosymp_state_mult' multiplier for test probability for agents who are infected but not shopwing symptoms (Ia or Ip) ; 'symp_state_mult' multiplier for test probability for agents who are infected andshowing symptoms (Im or Imh) ; 'hosp_mult' multiplier for test probability for agents who are infected and hospitalized ; 'test.red' reduction in transmission probability if agents has tested positive. LIST 'other_pars' containing 'visitor_mult_testing' multiplier to adjust probability visiting agent is infected based on ratio of true incidence to incidence identified via testing ; 'visitor_mult_sfgrph' multiplier to adjust total number of visitors from safegraph number of visitors based on ratio of tracked safegraph devices to total movement of people ; 'mask_fx' a function to return individual agent probabilities of wearing a mask outside the household ; 'mask_red' reduction in transmission probability if agent wears mask ; 'social_fx' function to generate agent sociality metrics. LIST 'adapt_pars' containing: 'adapt_start' time point at which to start adaptive testing ; 'adapt_freq' frequency with which to check test reports and generate new test site ; 'adapt_site_fx' function to determine when and where to place adaptive testing sites ; 'adapt_site_geo' geography to base adaptive sites on only option is 'ct' for now ; 'n_adapt_sites' how many adaptive sites available to place ; 'adapt_site_test_criteria' character either 'n_pos'or 'pct_pos'for whteher targeted sites should be added based on census tract with highest number positive tests or highest percent positive tests ; 'adapt_site_mult' increase in testing probability if test site is placed in residence ct ; 'adapt_site_delay_fx' function to generate time delay for test conducted to disclosure for agents in cts with adaptive sites. 'vax_phases' should contain three lists each of the same length: 'dates' containing start dates of new vaccination eligibility phases, 'ages' with entries containing ages of eligilibility for vaccination, and 'occps' containing numerical codes for occupations eligible for vaccination. All three lists should be same length and are additive, i.e. agents in phase 1 still unvaccinated in phase two will remain eligible for phase 2. agents must also meet both age and occp criteria for eligibility. each entry should define a group eligible for vaccination, so if two groups becoming eligible at same time, separate entries required by replicating date in 'dates' and defining separate criteria in 'ages' and 'occps'. See 'Analysis/0-Prep-Agents.R' for occp codes.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.