All problems
Likelihood Ratio Statistic
Problem
Return the likelihood ratio statistic 2*(log_lik_full - log_lik_reduced). The statistic is non-negative when the full model contains the reduced model.
Hint
The statistic compares maximized log-likelihoods.
Test cases
case 1
in: [-100,-110]
expected: 20
case 2
in: [-50,-50]
expected: 0
case 3
in: [-10,-12]
expected: 4
case 4
in: [-180,-200]
expected: 40
case 5
in: [-5,-6]
expected: 2
Starter codePython
def likelihood_ratio_statistic(ll_full, ll_reduced):
# Your code here
pass5 test cases · run your code against them in the editor