hierarchical_bayesian_model: Hierarchical Bayesian Model

View source: R/hierarchical_bayesian_model.R

hierarchical_bayesian_modelR Documentation

Hierarchical Bayesian Model

Description

Refers to section 10.3

Usage

hierarchical_bayesian_model(
  age,
  pos = NULL,
  tot = NULL,
  status = NULL,
  type = "far3",
  chains = 1,
  warmup = 1500,
  iter = 5000
)

Arguments

age

the age vector

pos

the positive count vector (optional if status is provided).

tot

the total count vector (optional if status is provided).

status

the serostatus vector (optional if pos & tot are provided).

type

type of model ("far2", "far3" or "log_logistic")

chains

number of Markov chains

warmup

number of warmup runs

iter

number of iterations

Value

a list of class hierarchical_bayesian_model with 6 items

datatype

type of datatype used for model fitting (aggregated or linelisting)

df

the dataframe used for fitting the model

type

type of bayesian model far2, far3 or log_logistic

info

parameters for the fitted model

sp

seroprevalence

foi

force of infection

Examples


df <- mumps_uk_1986_1987
model <- hierarchical_bayesian_model(age = df$age, pos = df$pos, tot = df$tot, type="far3")
model$info
plot(model)


serosv documentation built on Oct. 18, 2024, 5:07 p.m.