Skip to contents

Create a faceted `ggplot2` panel showing observed and fitted values for the selected epidemic models.

Usage

plot_fit(
  object,
  point_size = 1.2,
  line_size = 1,
  models = c("Exponential", "Monomolecular", "Logistic", "Gompertz")
)

Arguments

object

A fitted object returned by `fit_lin()`, `fit_nlin()`, or `fit_nlin2()`.

point_size

Point size for observed values.

line_size

Line width for fitted curves.

models

Character vector with the models to display.

Value

A `ggplot2` object.

Examples

epi <- sim_logistic(N = 30, y0 = 0.01, dt = 5, r = 0.3, alpha = 0.2, n = 4)
fit <- fit_lin(time = epi$time, y = epi$random_y)
plot_fit(fit)