Given a large vector of likelihood values and a vector, indices, of length n_indivs, sums the likelihoods to give one value per individual, where indices indicates which individual each index of liks corresponds to.
sum_likelihoods(liks, indices, n_indivs)
liks | NumericVector of likelihoods |
---|---|
indices | IntegerVector of indices of same length as liks, where the max value of this should be the same as n_indivs - 1 |
n_indivs | int, number of individuals to generate bucketed likelihoods for |