FORECASTplot | R Documentation |
This function is used to create a plot of simultaneous confidence bands.
FORECASTplot(
modeldata,
model_res,
forecast_res,
ncol,
targetdata = NULL,
legend = TRUE
)
modeldata |
The long-format data frame/table of virus concentration |
model_res |
The fitted model from WWmodel() |
ncol |
The number of columns in the plot |
targetdata |
The “future” observations to be forecasted (the default is NULL) |
legend |
If a lengend should be included (the default is TRUE) |
The plot of simultaneous confidence bands.
rawdata = as.data.table(readRDS("ww-db-2021-09-10.rds"))
modeldata = DataPrep(rawdata, "N1")
targetdata = modeldata[date < as.Date("2021-06-15") & date > as.Date("2021-05-15")]
modeldata = modeldata[date <= as.Date("2021-05-15")]
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(20, modeldata, model_res, ID, date, value, covariate, 5000, 2500)
FORECASTplot(modeldata, model_res, forecast_res, 4, targetdata)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.