dist_prob: Fit a distribution to pair_wise bottlenecks

Description Usage Arguments Value Examples

Description

This funciton returns the negative log likelihood for a distribution of bottlenecks given a data frame of fits on a per-pair basis. This can be used with mle from the bbmle package.

Usage

1
dist_prob(data, weight, ddist, ...)

Arguments

data

A tibble or data frame as outputed from trans_fit

weight

A tibble or data frame providing the weighting factors for each pair. It should have columns pair Id and weight_factor

ddist

The pdf or pmf function for the distribution to test.

...

The parameters to pass to the ddist function

Value

the negative Log likelihood weighted by the weighted data frame

Examples

1
2
3
4
5
6
7
require(magrittr)
require(dplyr)
fit <-trans_fit(small_trans,100,"PA",threshold = NULL,acc=NULL,pair_id)
weights<-small_trans %>% group_by(pair_id) %>%
summarize(donor_mutants = length(which(freq1>0 & freq1<0.5))) %>%
 mutate(weight_factor = max(donor_mutants)/donor_mutants)
dist_prob(fit,weights,dzpois,lambda=1)

jtmccr1/HIVEr documentation built on May 29, 2019, 1:50 a.m.