apply.null.models: Apply Null Models

View source: R/NullModels.R

apply.null.modelsR Documentation

Apply Null Models

Description

Runs the null models as a group and create an joint output data frame and a timing data frame. NOTE: the always absent and mean value were NOT calculated using the apply.always.absent.null function or the apply.mean.value.null functions - these were created later and have not been edited into the code.

Usage

apply.null.models(
  in.data,
  n.draws,
  nulls = "ALL",
  out.path = NA,
  in.seed = 20210622
)

Arguments

in.data

A data set containing 'location' field with locations, annual human cases in a 'count' field, and year in a 'year' field. Note that field names must match EXACTLY. For Stratified Incidence and Random Incidence, human population also needs to be included in a 'POP' field.

n.draws

The number of probabilistic draws to make for each location.

nulls

Which null models to run. Default of "ALL" runs all models. Individual models can be run with 2-letter abbreviations in a vector:

HN Historical Null
NB Negative Binomial
AA Always Absent
SI Stratified Incidence
RI Random Incidence
AR Autoregressive 1
SM Stratified Mean
PY Prior Year
UN Uniform Null
MV Mean Value
out.path

The path to write the crps.df and time.df data objects. If no output is desired, set this to NA (default).

in.seed

The starting seed to ensure replicability of the random processes

Value

A list with four elements: crps.df; time.df; sample.size.vec, and a list of model specific results. crps df is a data frame with the average CRPS score for that year for each null model, while time.df contains the timing for each null model. sample.size.vec contains a list of sample sizes by year, while the model.lists object contains the individual county CRPS scores by year.


akeyel/dfmip documentation built on Sept. 3, 2022, 1:26 a.m.