[Stable] Takes the output from rt_opts() and converts it into a list understood by stan.

create_rt_data(rt = rt_opts(), breakpoints = NULL, delay = 0, horizon = 0)

Arguments

rt

A list of options as generated by rt_opts() defining Rt estimation. Defaults to rt_opts(). Set to NULL to switch to using back calculation rather than generating infections using Rt.

breakpoints

An integer vector (binary) indicating the location of breakpoints.

delay

Numeric mean delay

horizon

Numeric, forecast horizon.

Value

A list of settings defining the time-varying reproduction number

See also

rt_settings

Examples

# default Rt data
create_rt_data()
#> $r_mean
#> [1] 1
#> 
#> $r_sd
#> [1] 1
#> 
#> $estimate_r
#> [1] 1
#> 
#> $bp_n
#> [1] 0
#> 
#> $breakpoints
#> NULL
#> 
#> $future_fixed
#> [1] 1
#> 
#> $fixed_from
#> [1] 0
#> 
#> $pop
#> [1] 0
#> 
#> $stationary
#> [1] 0
#> 
#> $future_time
#> [1] 0
#> 

# settings when no Rt is desired
create_rt_data(rt = NULL)
#> $r_mean
#> [1] 1
#> 
#> $r_sd
#> [1] 1
#> 
#> $estimate_r
#> [1] 0
#> 
#> $bp_n
#> [1] 0
#> 
#> $breakpoints
#> NULL
#> 
#> $future_fixed
#> [1] 0
#> 
#> $fixed_from
#> [1] 0
#> 
#> $pop
#> [1] 0
#> 
#> $stationary
#> [1] 1
#> 
#> $future_time
#> [1] 0
#> 

# using breakpoints
create_rt_data(rt_opts(use_breakpoints = TRUE), breakpoints = rep(1, 10))
#> $r_mean
#> [1] 1
#> 
#> $r_sd
#> [1] 1
#> 
#> $estimate_r
#> [1] 1
#> 
#> $bp_n
#> [1] 10
#> 
#> $breakpoints
#>  [1] 1 1 1 1 1 1 1 1 1 1
#> 
#> $future_fixed
#> [1] 1
#> 
#> $fixed_from
#> [1] 0
#> 
#> $pop
#> [1] 0
#> 
#> $stationary
#> [1] 0
#> 
#> $future_time
#> [1] 0
#>