Skip to content

Different log-likelihood function #8

@hannahbav

Description

@hannahbav

In the paper, the log likelihood is the sum of cancel rates times log probabilities, plus the end survived rate times final survivor likelihood. Should it therefore not be

def log_likelihood(alpha, beta, data, survivors=None):
    if alpha <= 0 or beta <= 0:
        return -1000
    if survivors is None:
        survivors = cancel_rates
    probabilities = generate_probabilities(alpha, beta, len(data))
    final_survivor_likelihood = survivor(probabilities, len(data) - 1)
    
    return sum([s * np.log(probabilities[t]) for t, s in enumerate(data)]) + survivors[-1] * np.log(final_survivor_likelihood)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions