Computes relative fitness of each lineage from a fitted model. Supports four output formats for different use cases.
Usage
growth_advantage(
fit,
type = c("growth_rate", "relative_Rt", "selection_coefficient", "doubling_time"),
generation_time = NULL,
ci_level = NULL
)Arguments
- fit
An
lfq_fitobject returned byfit_model().- type
Output type:
"growth_rate"(default): raw growth rate delta pertime_scaledays (typically per week)."relative_Rt": relative effective reproduction number. Requiresgeneration_time."selection_coefficient": relative Rt minus 1. Requiresgeneration_time."doubling_time": days for frequency ratio vs pivot to double (positive = growing) or halve (negative = declining).
- generation_time
Mean generation time in days. Required for
type = "relative_Rt"and"selection_coefficient". Common values: SARS-CoV-2 approximately 5 days, influenza approximately 3 days.- ci_level
Confidence level for intervals. Default uses the level from the fitted model.
Value
A tibble with columns:
- lineage
Lineage name.
- estimate
Point estimate.
- lower
Lower confidence bound.
- upper
Upper confidence bound.
- type
Type of estimate.
- pivot
Name of pivot (reference) lineage.
Details
The "relative_Rt" and "selection_coefficient" types use the
Piantham approximation (Piantham et al. 2022,
doi:10.3390/v14112556
), which assumes:
Variants are in their exponential growth phase (not saturating due to population-level immunity).
All variants share the same generation time distribution.
Growth advantage reflects transmissibility differences; immune escape is not separately identified.
Confidence intervals for "relative_Rt" are computed in
log-space (Wald intervals on log-Rt), which is more accurate
than the linear delta method for ratios.
References
Piantham C, Linton NM, Nishiura H (2022). Predicting the trajectory of replacements of SARS-CoV-2 variants using relative reproduction numbers. Viruses, 14(11):2556. doi:10.3390/v14112556
Abousamra E, Figgins M, Bedford T (2024). Fitness models provide accurate short-term forecasts of SARS-CoV-2 variant frequency. PLoS Computational Biology, 20(9):e1012443. doi:10.1371/journal.pcbi.1012443
Examples
sim <- simulate_dynamics(
n_lineages = 3,
advantages = c("JN.1" = 1.3, "KP.3" = 0.9),
n_timepoints = 15, seed = 42
)
fit <- fit_model(sim, engine = "mlr")
# Growth rates per week
growth_advantage(fit, type = "growth_rate")
#> # A tibble: 3 × 6
#> lineage estimate lower upper type pivot
#> <chr> <dbl> <dbl> <dbl> <chr> <chr>
#> 1 JN.1 0.364 0.338 0.390 growth_rate KP.3
#> 2 KP.3 0 0 0 growth_rate KP.3
#> 3 ref 0.112 0.0834 0.141 growth_rate KP.3
# Relative Rt (needs generation time)
growth_advantage(fit, type = "relative_Rt", generation_time = 5)
#> # A tibble: 3 × 6
#> lineage estimate lower upper type pivot
#> <chr> <dbl> <dbl> <dbl> <chr> <chr>
#> 1 JN.1 1.30 1.27 1.32 relative_Rt KP.3
#> 2 KP.3 1 1 1 relative_Rt KP.3
#> 3 ref 1.08 1.06 1.11 relative_Rt KP.3