Skip to content

Repository files navigation

incast incast website

R-CMD-check Codecov test coverage

incast is an R package for infectious disease nowcasting and forecasting. It was developed through Insight Net, a CDC Center for Forecasting and Outbreak Analytics initiative.

Use it to fetch or validate data, correct reporting delays, compare models and produce forecasts.

Installation

Install the development version from GitHub:

# install.packages("pak")
pak::pak("ACCIDDA/incast")

Quick start

library(incast)
tail(example_data)
#> # A tibble: 6 × 5
#>   as_of      location target          target_end_date observation
#>   <date>     <chr>    <chr>           <date>                <dbl>
#> 1 2025-12-07 CA       wk inc flu hosp 2025-12-06              233
#> 2 2025-12-14 CA       wk inc flu hosp 2025-12-06              259
#> 3 2025-12-07 NY       wk inc flu hosp 2025-12-06             1160
#> 4 2025-12-14 NY       wk inc flu hosp 2025-12-06             1171
#> 5 2025-12-14 CA       wk inc flu hosp 2025-12-13              412
#> 6 2025-12-14 NY       wk inc flu hosp 2025-12-13             1462
fcast <- example_data |>
  check_data() |>
  get_ncast() |>
  get_cv(eval_start_date = as.Date("2024-10-01")) |>
  get_fcast()
fcast
#> <incast_fcast>
#> Target:   wk inc flu hosp
#> Series:   2 (location)
#> Forecast: 2025-12-20 to 2026-01-10 (h = 4)
#> Models:   4 + ENSEMBLE

fcast |> autoplot()

Save a forecast for myRespiLens:

library(dplyr)
fcast$hub$model_out_tbl |>
  dplyr::mutate(
    location = dplyr::recode(
      location,
      CA = "06",
      NY = "36"
    )
  ) |>
  write.csv("myrespilens_forecast.csv", row.names = FALSE)

Citation

To cite incast:

citation("incast")
#> To cite package 'incast' in publications use:
#> 
#>   Geismar C (2026). _incast: Tools for Epidemic Forecasting_. R package
#>   version 0.0.1, <https://github.com/ACCIDDA/incast>.
#> 
#> A BibTeX entry for LaTeX users is
#> 
#>   @Manual{,
#>     title = {incast: Tools for Epidemic Forecasting},
#>     author = {Cyril Geismar},
#>     year = {2026},
#>     note = {R package version 0.0.1},
#>     url = {https://github.com/ACCIDDA/incast},
#>   }

Acknowledgements

incast uses baselinenowcast and fable. It returns forecasts in hubverse format for submission to CDC forecast hubs.

About

A complete pipeline for infectious disease forecasting

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages