Compute probability from samples that person A infects person B

compute_A_infects_B(df)

Arguments

df

data frame with the following columns

cluster_id

unique ID of cluster

prob_trans

individual probability of transmission

like

likelihood of cluster

id

id of person within cluster

inf_id

infector ID of person

feature_id

a unique person/or set of features across the MC clusters

Value

a n x n matrix where n is the number of individuals in the cluster. The rows correspond to the INFECTOR id and the columns to the INFECTED id. So entry i,j is the probability i infects j