models_lags: Fits the models to training data and generates the...

View source: R/WNV_models_lags.r

models_lagsR Documentation

Fits the models to training data and generates the predictions

Description

Fits the models to training data and generates the predictions

Usage

models_lags(
  allmods,
  allLagsT,
  allLagsO,
  fillzeros,
  allunits,
  nsim,
  predict_from = c("best", "all")
)

Arguments

allmods

List of models

allLagsT

Training data

allLagsO

Out-of-sample data

fillzeros

Logical. If TRUE fill in with zeros counties that have no cases ever.

allunits

Character. Vector of county names in complete data set. Used when fillzeros == TRUE

nsim

Integer. Number of samples to draw from posterior distribution. Defaults to zero, which has the expected value of cases in predcases.

predict_from

Character. predict from AIC best model only, or from all models?

Value

Returns predictions for the out-of-sample year, a list of fitted models, AIC scores, and the model with the lowest AIC score. The predictions object could be a vector (nsim = 0 and predict_from == "best"), a matrix (nsim > 0 and predict_from == "best"), or a list of vectors or matrices (predict_from == "all")


khelmsmith/flm_NE_WNV documentation built on June 24, 2022, 11:13 p.m.