WWmodel: Main WWmodel function

View source: R/Main.R

WWmodelR Documentation

Main WWmodel function

Description

This is the main function for fitting WWmodel.

Usage

WWmodel(
  modeldata,
  ID,
  date,
  value,
  covariate = NULL,
  iteration,
  burnin,
  cores = 1
)

Arguments

modeldata

The long-format data frame/table of virus concentration

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 is the main function used to fit a WWmodel. See ?WWforecast and ?FORECASTplot for how to make forecasts using a fitted WWmodel.

Value

fit The fitted MCMC model

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)
model_res$fit

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