## Data set for the examples: (All examples include 5 time windows)
input_beta <- c( 0.30, 0.10, 0.15, 0.15, 0.20)
input_dist_phi <- c( 200, 200, 20, 150, 150)
input_m <- c( 0.002, 0.002, 0.002, 0.02, 0.02)
input_imm_frac <- c( 0.0, 0.0, 0.0, 0.02, 0.02)
input_window_length <- c( 10, 35, 46, 81, 40)
input_start_dates <- c(seq(as.Date("2020-07-09"), by=10, len=5))
input_end_dates <- c(seq(as.Date("2020-07-18"), by=10, len=5))
input_daily <- c(seq(as.Date("2020-07-09"), by=1, len=5))
## Example using window_length:
### input_window_length defines the number of days
### that each value of the other parameters is repeated.
tw <- time_windows(beta = input_beta,
dist_phi = input_dist_phi,
m = input_m,
imm_frac = input_imm_frac,
window_length = input_window_length)
## Example using start_dates with end_dates:
### Five time windows, each with 10 days
tw <- time_windows(beta = input_beta,
dist_phi = input_dist_phi,
m = input_m,
imm_frac = input_imm_frac,
start_dates = input_start_dates,
end_dates = input_end_dates)
## Example using daily:
### Parameters are updated daily over 5 days
tw <- time_windows(beta = input_beta,
dist_phi = input_dist_phi,
m = input_m,
imm_frac = input_imm_frac,
daily = input_daily)
## Example with different beta vectors for different populations:
### n_pops should be the total number of populations as used in covid19_control or seir_control
n_pops <- 4
input_beta_list <- vector("list", length = n_pops)
input_beta_list[[1]] <- c( 0.30, 0.10, 0.10, 0.15, 0.20)
input_beta_list[[2]] <- c( 0.15, 0.08, 0.15, 0.10, 0.15)
input_beta_list[[3]] <- c( 0.20, 0.08, 0.10, 0.10, 0.25)
input_beta_list[[n_pops]] <- c( 0.25, 0.12, 0.08, 0.12, 0.10)
tw <- time_windows(beta = input_beta_list,
dist_phi = input_dist_phi,
m = input_m,
imm_frac = input_imm_frac,
window_length = input_window_length)
Run the code above in your browser using DataLab