Skip to content

replace dist_spec() code with get_parameter() + Gamma() or LogNormal() #2

Closed
@avallecam

Description

@avallecam

replace

serial_interval_covid <-
dist_spec(
mean = covid_serialint$summary_stats$mean,
sd = covid_serialint$summary_stats$sd,
max = covid_serialint_discrete_max,
distribution = "lognormal"
)
serial_interval_covid

from

# update: EpiNow2 1.4.9 ---------------------------------------------------

si_x <- seq(1L, to = covid_serialint_discrete_max, by = 1L)

serial_interval_covid_update <- 
  EpiNow2::dist_spec(pmf = covid_serialint_discrete$prob_dist$d(si_x))

serial_interval_covid_update
#> - nonparametric distribution
#>   PMF: [0.0073 0.1 0.2 0.19 0.15 0.11 0.075 0.051 0.034 0.023 0.016 0.011 0.0076 0.0053 0.0037 0.0027 0.0019 0.0014 0.001 0.00074 0.00055 0.00041 0.00031]

key learning goals

  • a simple way to plug in epiparameter is using the pmf
  • we can also use functions like LogNormal() or Gamma() but these require more (unnecessary) parameters
  • we need max parameter to plug in LogNormal() output to epinow()
  • the max parameter can come from a discretized continuous function as an epidist object

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions