Skip to contents

This observation model observes the latent biomarker quantities given a discrete assay with user-specified ranges within the "discrete" argument and no added noise.

Usage

observation_model_discrete(biomarker_states, model_pars, cutoffs, ...)

Arguments

biomarker_states

tibble containing true biomarker quantities for all individuals across all time steps and biomarkers. Variables should include: 1) i: the individual ID; 2) t: the time period; 3) b: the biomarker ID; 4) value: the latent biomarker quantity for the given i, t and b

model_pars

a tibble containing information for all parameters needed to simulate the observation process. This should usually contain: 1) exposure_id: numeric exposure ID; 2) biomarker_id: numeric biomarker ID; 3) name: the character name of the parameter; 4) mean: numeric mean of this parameter distribution; 5) sd: the numeric standard deviation of the parameter distribution

cutoffs

a matrix containing the assay cutoffs for each biomarker. Each row contains all of the cutoffs for that biomarker starting with 0. For example, all of the cutoffs for the assay measuring biomarker 1 quantity are in the first row of this matrix.

...

Additional arguments

Value

biomarker_states is returned with a new column, observed, for observed biomarker quantities

Examples

breaks <- seq(0,8,by=1)
cutoffs <- matrix(breaks,nrow=1,ncol=length(breaks))
observation_model_discrete(example_biomarker_states, NULL,cutoffs)
#>          i   t b    value observed
#>     1:   1   1 1  0.00000        0
#>     2:   1   2 1  0.00000        0
#>     3:   1   3 1  0.00000        0
#>     4:   1   4 1  0.00000        0
#>     5:   1   5 1  0.00000        0
#>    ---                            
#> 11996: 100 116 1 16.26414        8
#> 11997: 100 117 1 16.20296        8
#> 11998: 100 118 1 16.14178        8
#> 11999: 100 119 1 16.08060        8
#> 12000: 100 120 1 16.01942        8