sample_nb_Rt_piece: Uses importance resampling to infer a posterior over Rt under...

View source: R/sampling.R

sample_nb_Rt_pieceR Documentation

Uses importance resampling to infer a posterior over Rt under a negative binomial renewal model

Description

Uses importance resampling to infer a posterior over Rt under a negative binomial renewal model

Usage

sample_nb_Rt_piece(
  prior_shape,
  prior_rate,
  posterior_shape,
  posterior_rate,
  kappa,
  w,
  onset_times,
  cases_df,
  ndraws,
  nresamples
)

Arguments

prior_shape

Rt prior shape parameter

prior_rate

Rt prior rate parameter

posterior_shape

Rt posterior shape parameter

posterior_rate

Rt posterior rate parameter

kappa

overdispersion parameter

w

weights corresponding to the generation times

onset_times

the onset times corresponding to the piece

cases_df

a tibble with 'cases_true' as a column which has been ordered so that the latest onset times are at the bottom

ndraws

number of draws of Rt to return

nresamples

number of resamples used to calculate weights for

Value

a vector of Rt draws


ben18785/incidenceinflation documentation built on Feb. 8, 2024, 2:36 a.m.