log_likelihood {serocalculator} | R Documentation |
Calculate log-likelihood
Description
Calculates the log-likelihood of a set of cross-sectional antibody response data, for a given incidence rate (lambda
) value.
Usage
log_likelihood(
lambda,
pop_data,
antigen_isos,
curve_params,
noise_params,
verbose = FALSE,
...
)
Arguments
lambda |
|
pop_data |
a |
antigen_isos |
Character vector listing one or more antigen isotypes. Values must match |
curve_params |
a
|
noise_params |
a
|
verbose |
logical: if TRUE, print verbose log information to console |
... |
additional arguments passed to other functions (not currently used). |
Value
the log-likelihood of the data with the current parameter values
Examples
library(dplyr)
library(tibble)
#load in longitudinal parameters
dmcmc = load_curve_params("https://osf.io/download/rtw5k")
xs_data <- "https://osf.io/download//n6cp3/" %>%
load_pop_data() %>%
clean_pop_data()
#Load noise params
cond <- tibble(
antigen_iso = c("HlyE_IgG", "HlyE_IgA"),
nu = c(0.5, 0.5), # Biologic noise (nu)
eps = c(0, 0), # M noise (eps)
y.low = c(1, 1), # low cutoff (llod)
y.high = c(5e6, 5e6)) # high cutoff (y.high)
#Calculate log-likelihood
ll_AG = log_likelihood(
pop_data = xs_data,
curve_params = dmcmc,
noise_params = cond,
antigen_isos = c("HlyE_IgG","HlyE_IgA"),
lambda = 0.1) %>% print()