WWforecast: Main forecasting function

View source: R/Forecast.R

WWforecastR Documentation

Main forecasting function

Description

This is the main forecasting function for a fitted WWmodel.

Usage

WWforecast(
  h.ahead,
  modeldata,
  model_res,
  ID,
  date,
  value,
  covariate = NULL,
  iteration,
  burnin
)

Arguments

h.ahead

The number of steps ahead for which prediction is required

modeldata

The long-format data frame/table of virus concentration

model_res

The model result from WWmodel()

ID

Names of curve IDs (used to identify a unique curve)

date

Name of date column

value

Name of value column

covariate

Names of covariates (default is NULL)

iteration

A positive integer specifying the number of iterations for each chain (including burnin).

burnin

The number of burnin iterations

Details

This function is used to make forecasts using a fitted WWmodel. See ?FORECASTplot for how to plot the forecasts.

Value

Ypred The forecast of observed virus concentration

Examples

rawdata = as.data.table(readRDS("ww-db-2021-09-10.rds"))
modeldata = DataPrep(rawdata, "N1")

ID = c("Location", "target", "replicate")
date = "date"
value = "log10.value.raw"
covariate = c("dinflvol", "temp")
model_res = WWmodel(modeldata, ID, date, value, covariate, 5000, 2500)

forecast_res = WWforecast(5, modeldata, model_res, ID, date, value, covariate, 5000, 2500)

xiaotiand/WWmodel documentation built on May 15, 2023, 6:58 a.m.