Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different log-likelihood function #8

Open
hannahbav opened this issue Nov 9, 2020 · 0 comments
Open

Different log-likelihood function #8

hannahbav opened this issue Nov 9, 2020 · 0 comments

Comments

@hannahbav
Copy link

hannahbav commented Nov 9, 2020

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant