add_noise: Add noise

View source: R/simulate_data.R

add_noiseR Documentation

Add noise

Description

Adds truncated noise to antibody data

Usage

add_noise(y, theta, measurement_bias = NULL, indices = NULL, data_type = 1)

Arguments

y

the titre

theta

a vector with max_measurement and error parameters

data_type

integer, currently accepting 1 or 2. Set to 1 for discretized, bounded data, or 2 for continuous, bounded data. 3 is for continuous data assuming that true negatives follow a different distribution – the vast majority return the min_measurement, but with a rate fp_rate, a random draw from a uniform distribution within the limits of detection is generated.

Value

a noisy titre

Examples

## Not run: 
## ... example in simulate_individual
pars <- c("obs_sd"=1)
y <- runif(100)
noisy_y <- add_noise(y, pars)

## End(Not run)

seroanalytics/serosolver documentation built on Dec. 14, 2024, 5:33 a.m.