예제 #1
0
def independent_binomial_log_likelihood( data, parameters ):
    a = data.a
    b = data.b
    
    d = a + b
    
    mu = parameters['mu']

    log_likelihoods = log_binomial_likelihood( a, d, mu )

    pi = parameters['pi']
    log_pi = np.log( pi )

    log_likelihoods = log_likelihoods + log_pi
    
    return log_likelihoods
예제 #2
0
def joint_binomial_log_likelihood( data, parameters ):
    log_likelihoods = {}
    
    for genome in constants.genomes:
        a = data.a[genome]
        b = data.b[genome]
        d = a + b
        
        mu = parameters[genome]['mu']
    
        log_likelihoods[genome] = log_binomial_likelihood( a, d, mu )

    pi = parameters['pi']

    log_likelihoods = get_joint_log_likelihoods( log_likelihoods, pi )
    
    return log_likelihoods