loglike_cond_fast: Calculate the log likelihood of a cluster conditioned on size...

Description Usage Arguments Details Value

View source: R/loglike-faster2.R

Description

Calculate the log likelihood of a cluster conditioned on size and smear pos. num

Usage

1
loglike_cond_fast(p_plus, p_neg, clust_df, is_truncated = FALSE, w_pos = 0.5)

Arguments

p_plus

probability of smear pos

p_neg

probability of smear neg

clust_df

data frame with the following columns

is_truncated

logical default is FALSE

w_pos

empirical weights of number of positive smears

i_pos

number of transmission from a smear positive person

i_neg

number of transmission from a smear negative person (optional)

n_pos

number of positive smears

n

cluster size

freq

frequency of time this particular cluster occurs

Details

if i_neg is not a column in clust_df we will use n-i_pos - 1 as i_neg. If 'is_truncated' is TRUE, we will calculate the the zero-truncated likelihood

Value

log likelihood summed over the clusters


skgallagher/TBornotTB documentation built on April 21, 2020, 1:19 p.m.