posterior_func_group_cpp: Posterior calculation cpp implementation

Description Usage Arguments Value

View source: R/RcppExports.R

Description

Solves the antibody kinetics model for given parameters, and then calculates a likelihood for the given data set. This is a complex function, so should only really be called through create_model_group_func_cpp. Lookx at this code to really understand what's going on! The key confusing thing is that the length of the vectors has to match the number of rows from the overall parameter table

Usage

1
2
3
4
5
posterior_func_group_cpp(pars, times, groups, strains, exposure_indices,
  exposure_i_lengths, strain_indices, strain_i_lengths, exposure_times,
  exposure_strains, exposure_next, exposure_measured, exposure_orders,
  exposure_primes, cr_inds, par_inds, par_names, order_inds, par_lengths,
  cr_lengths, version, individuals, data)

Arguments

pars

the vector of model parameters as in parTab

times

the vector of times to solve the model over

groups

IntegerVector of the exposure groups (starting at group 1)

strains

IntegerVector of strains involved in exposures (ie. observed and exposed), starting at 1

exposure_indices

IntegerVector of indices from the exposure table

exposure_i_lengths

IntegerVector of lengths describing the size of blocks in the exposure_indices vector that relate to each exposure group

strain_indices

IntegerVector of indices relating to the exposure table, with contiguous indices for each group and then each strain

strain_i_lengths

IntegerVector of lengths describing the size of blocks in the strain_indices vector that relate to each strain and group

exposure_times

NumericVector infection time of each exposure

exposure_strains

IntegerVector of exposure strains for each exposure

exposure_next

NumericVector specifying the time of the exposure after the current one (for subsetting times)

exposure_measured

IntegerVector of measured strain for each exposure

exposure_orders

IntegerVector of order of exposures

exposure_primes

IntegerVector of whether each exposure was primed or not (for priming modifier)

cr_inds

IntegerVector of indices describing which parTab rows relate to cross reactivity parameters

par_inds

IntegerVector of indices describing which parTab rows relate to model parameters

par_names

CharacterVector names from parTab

order_inds

IntegerVector of indices describing which parTab rows relate to order modifer parameters

par_lengths

IntegerVector of lengths describing the size of blocks in the par_type_ind vector that relate to each exposure type

cr_lengths

IntegerVector of lengths describing the size of blocks in the cr_ind vector that relate to each strain

version

integer indicating which version of the model will be solve. 0 solves the isolated form, and 1 solves the competitive exposure form.

individuals

IntegerVector indicating how many individuals there are in each group

data

NumericMatrix of antibody titre data. Each row should be complete observations of titres against a given strain for a given group. If we have 5 strains measured and 5 groups, rows 1:5 should be titres in group 1, rows 6:10 titres in group 3 etc. If more than 1 individual in each group, multiply these criteria by number of inidividuals in that group (ie., rows 1:15 for group 1)

exposure_i_lengths

IntegerVector of lengths describing the size of blocks in the exposure_indices vector that relate to each exposure group

Value

a single likelihood of observing the data given the model parameters


jameshay218/antibodyKinetics documentation built on Nov. 8, 2019, 11 a.m.