All problems
AIC Difference
Problem
Return AIC2 - AIC1, where AIC = -2*log_likelihood + 2*k for each model. Negative values favor the second model.
Hint
Compute each AIC, then subtract.
Test cases
case 1
in: [-100,2,-110,5]
expected: 26
case 2
in: [-50,1,-50,1]
expected: 0
case 3
in: [-10,3,-12,2]
expected: 2
case 4
in: [-200,10,-180,10]
expected: -40
case 5
in: [-5,0,-6,0]
expected: 2
Starter codePython
def aic_difference(ll1, k1, ll2, k2):
# Your code here
pass5 test cases · run your code against them in the editor