Description Usage Arguments Value Mock birth data Missing data Effective observation interval References Examples
View source: R/estimate_beta_FC.R
estimate_beta_FC()
applies the FC method (see References)
to estimate the timevarying transmission rate
β(t)
from time series of reported incidence and births, observed at
equally spaced time points
t_{k} = t_{0}+kΔt
(for k = 0,...,n),
where
Δt
denotes the observation interval.
1  estimate_beta_FC(df = data.frame(), par_list = list())

df 
A data frame with numeric columns:

par_list 
A list containing:

A data frame with numeric columns:
t
Time. Identical to df$t
.
C
Reported incidence, imputed. Identical to df$C
,
except with missing values and zeros imputed (see Details).
Z
Incidence. Z[i]
is the estimated
number of infections between times t[i1]
and t[i]
.
Z_agg
Aggregated incidence. Z_agg[i]
is the estimated
number of infections between times t[iround(tgen)+1]
and
t[i]
, for i
in seq(1 + round(tgen), nrow(df), by = round(tgen))
.
Z_agg[i]
is NA
otherwise.
B
Births, imputed. Identical to df$B
(if supplied),
except with missing values imputed (see Details).
B_agg
Aggregated births. B_agg[i]
is the
number of births between times t[iround(tgen)+1]
and t[i]
,
for i
in seq(1 + round(tgen), nrow(df), by = round(tgen))
.
B_agg[i]
is NA
otherwise.
S
Number of susceptibles. S[i]
is the estimated
number of susceptibles at time t[i]
.
I
Number of infecteds. I[i]
is the estimated
number of infecteds at time t[i]
.
beta
Transmission rate. beta[i]
is the estimated
transmission rate at time t[i]
expressed per unit
Δt
per susceptible per infected.
It possesses par_list
as an attribute.
If df$B
is undefined in the function call, then df$B[i]
gets the value with(par_list, nu * hatN0 * 1)
for all i
.
Missing values in df[, c("C", "B")]
are not tolerated by
the FC method. They are imputed via linear interpolation
between observed values. If there are no observations
before the first missing value, then complete imputation
is impossible. In this case, the FC method may fail:
columns S
and beta
in the output may be filled with NA
.
Zeros in df$C
cause dividebyzero errors. To prevent these
errors, zeros are imputed like missing values. If there are
no nonzero observations before the first zero, then complete
imputation is impossible. In this case, the FC method may fail,
but only locally: column beta
in the output may contain some
NaN
and Inf
where an estimate would otherwise be expected.
(Estimates are not expected everywhere. See "Effective
observation interval".)
In the output, every with(par_list, round(tgen))
rows are
complete. The remaining rows contain NA
in columns S
, I
,
beta
, Z_agg
, and B_agg
. This is a limitation of the FC
method, which aggregates incidence and births over the mean
generation interval, making with(par_list, round(tgen))
the
effective observation interval. If this number is zero, then
the method fails.
deJonge MS, Jagan M, Krylova O, Earn DJD. Fast estimation of timevarying transmission rates for infectious diseases.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22  # Simulate a reported incidence time series using
# a seasonally forced transmission rate
par_list < make_par_list(dt_weeks = 1)
df < make_data(
par_list = par_list,
n = 20 * 365 / 7, # 20 years is ~1042 weeks
with_dem_stoch = FALSE
)
head(df)
# Estimate incidence, susceptibles, infecteds,
# and the seasonally forced transmission rate
df_FC < estimate_beta_FC(df, par_list)
head(df_FC)
# Estimation of susceptibles and transmission rate fails
# because the FC method ignores susceptible mortality
df_FC$t_years < df$t_years
plot(S ~ t_years, df, type = "l", ylim = c(43, 83) * 1e03)
lines(S ~ t_years, df_FC[!is.na(df_FC$S), ], col = "red")
plot(beta ~ t_years, df, type = "l", ylim = c(0.5, 1.2) * 1e05)
lines(beta ~ t_years, df_FC[!is.na(df_FC$beta), ], col = "red")

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.