FOImodel: Model of the force of infection

View source: R/FOImodel.R

FOImodelR Documentation

Model of the force of infection

Description

This function creates an object of the class FOImodel. Inputs are the type of the model (required), additional parameters if required by the model, and hyperparameters for the prior distributions (optional). The models to be given as an input are predefined. More details are given in the vignette models.

Usage

FOImodel(
  type = "constant",
  K = 1,
  group_size = 1,
  seroreversion = 0,
  se = 1,
  sp = 1,
  prioralpha1 = 0,
  prioralpha2 = 5,
  priorbeta1 = 0,
  priorbeta2 = 1,
  priorT1 = 1,
  priorT2 = 100,
  priorC1 = 0,
  priorC2 = 10,
  priorY1 = 0,
  priorY2 = 10,
  priorRho = 2,
  cat_lambda = 1,
  fixed_parameters = NULL,
  ...
)

## S3 method for class 'FOImodel'
print(x, ...)

Arguments

type

A character with the name of model. The options are:

  • 'constant': Constant force of infection

  • 'outbreak': Series of outbreak modeled with gaussians

  • 'independent': Annual independent values of the force of infection

  • 'piecewise': Piecewise constant force of infection. The number of phases with a constant level is given by the variable K

  • 'constantoutbreak': A combination of K outbreaks with a constant yearly force of infection

  • 'independent_group': Similar to the independent model, but with piecewise constant values of the force annual force of infection in time periods of length group_size years.

K

integer. An additional parameter used in the outbreak, constantoutbreak and piecewise stan models. In the case of the outbreaks, this parameter is the number of Gaussians used. In the case of the piecewise constant model it is the number of constant phases. Default = 1.

group_size

integer. An additional parameter used in the independent_group models. The force of infection is averaged over group_size year period. By default group_size = 1, which is equivalent ot the independent model.

seroreversion

integer, equal to 0 or 1. If seroreversion=0 the model includes a rate of seroreversion (waning immunity). See the vignette models for details. Default = 0.

se

numeric, between 0 and 1. If se=1 the assay has a perfect sensitivity. Default = 1.

sp

numeric, between 0 and 1. If sp=1 the assay has a perfect specificity. Default = 1.

prioralpha1

First parameter of the uniform prior distribution of the parameter alpha, used as the intensity of the force of infection in the outbreak models. Default = 0.

prioralpha2

Second parameter of the uniform prior distribution of the parameter alpha, used as the intensity of the force of infection in the outbreak models. Default = 5.

priorbeta1

First parameter of the uniform prior distribution of the parameter beta, used as the spread of the force of infection in the outbreak models. Default = 0.

priorbeta2

Second parameter of the uniform prior distribution of the parameter beta, used as the spread of the force of infection in the outbreak models. Default = 1.

priorT1

First parameter for the uniform distribution for the T parameter. The time of the outbreak is defined as the number of years before the survey (outbreak and constant outbreak models). It is the time interval for the change of FOI in the piecewise constant model. Default = 1.

priorT2

Second parameter for the uniform distribution for the T parameter. Default = 100.

priorC1

First parameter of the uniform prior distribution for the constant force of infection, used in the constant and piecewise constant models. Default = 0.

priorC2

Second parameter of the uniform prior distribution for the constant force of infection, used in the constant and piecewise constant models. Default = 10.

priorY1

First parameter of the uniform prior distribution for the annual hazard of infection, used in the independent models. Default = 0.

priorY2

Second parameter of the uniform prior distribution for the annual hazard of infection, used in the independent models. Default = 10.

priorRho

Parameter of the exponential prior distribution for rho, the seroreversion rate used when seroreversion=1. Default = 2. ##'

cat_lambda

integer, equal to 0 or 1. If cat_lambda=1 the force of infection varies accross the different categories defined in an objet SeroData. See the vignette models for details. Default = 1.

...

Additional arguments (not used).

x

A object of the class FOImodel.

Value

A list with the class FOImodel, which contains the following items:

  • type: The type of the model.

  • stanname: The name of the stan file used.

  • estimated_parameters: The number of estimated parameters.

  • priors: a list with the priors.

  • K: the input parameter used in the outbreak and piecewise models, if given.

Author(s)

Nathanael Hoze nathanael.hoze@gmail.com

Examples



## A gaussian model, with two gaussians, and user-defined priors
model <- FOImodel('outbreak',K = 2, prioralpha1 = 0, prioralpha2 = 1)

## A piecewise model, consisting in two constant phases, with seroreversion and user-defined priors
model <- FOImodel('piecewise', K=2, seroreversion=1, priorRho1=0.1)




nathoze/Rsero documentation built on Feb. 3, 2024, 9:58 p.m.