fit_growth_rate: Fit a growth rate model to time series cases.

View source: R/fit_growth_rate.R

fit_growth_rateR Documentation

Fit a growth rate model to time series cases.

Description

This function fits a growth rate model to time series cases and provides parameter estimates along with confidence intervals.

Usage

fit_growth_rate(
  cases,
  population = NULL,
  level = 0.95,
  family = c("quasipoisson", "poisson")
)

Arguments

cases

An integer vector containing the time series cases.

population

An integer vector containing the time series background population.

level

The confidence level for parameter estimates, a numeric value between 0 and 1.

family

A character string specifying the family for modeling. Choose between 'poisson', or 'quasipoisson'. Must be one of: character, family-generator, or family object.

Value

A list containing:

  • 'fit': The fitted growth rate model.

  • 'estimate': A numeric vector with parameter estimates, including the growth rate and its confidence interval.

  • 'level': The confidence level used for estimating parameter confidence intervals.

Examples

# Fit a growth rate model to a time series of counts
# (e.g., population growth)
data <- c(100, 120, 150, 180, 220, 270)
fit_growth_rate(
  cases = data,
  level = 0.95,
  family = "poisson"
)

aedseo documentation built on Nov. 18, 2025, 1:07 a.m.