R/observation_models.R
observation_model_continuous_noise.Rd
This observation model observes the latent biomarker quantities given a continuous assay with added noise. The added noise represents assay variability and is done by sampling from a distribution with the latent biomarker quantity as the mean and the measurement error as the standard deviation. The observation standard deviation and distribution are defined within model_pars as the obs_sd
parameter. The user can also use the optional sensitivity and specificity arguments to account for assay sensitivity and specificity. False negatives are simulated by setting an observed quantity to 0 with probability sensitivity
. False positives are simulated by drawing a random quantity from the bounded range for a true 0 biomarker quantity with probability 1-specificity
.
observation_model_continuous_noise(
biomarker_states,
model_pars,
sensitivity = 1,
specificity = 1,
...
)
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
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
number between 0 and 1 to describe the assay's sensitivity; defaults to 1
number between 0 and 1 to describe the assay's specificity; defaults to 1
Additional arguments
biomarker_states
is returned with a new column, observed
, for observed biomarker quantities
Other observation_model:
observation_model_continuous_bounded_noise()
,
observation_model_continuous_bounded()
,
observation_model_continuous()
,
observation_model_discrete_noise()
,
observation_model_discrete()
observation_model_continuous_noise(example_biomarker_states, example_model_pars_numeric, 0.95,0.99)
#> Warning: NAs produced
#> i t b value observed
#> 1: 1 1 1 NA NaN
#> 2: 1 2 1 NA NaN
#> 3: 1 3 1 NA NaN
#> 4: 1 4 1 NA NaN
#> 5: 1 5 1 NA NaN
#> ---
#> 11996: 100 116 1 NA NaN
#> 11997: 100 117 1 3.835267 3.624481
#> 11998: 100 118 1 3.823634 3.463139
#> 11999: 100 119 1 3.812000 0.000000
#> 12000: 100 120 1 3.800367 4.005121