All problems
MDL Crude Two-Part
Problem
Return the crude (Rissanen) two-part minimum description length in bits:
DL = nll_bits + 0.5 * n_params * log2(n_samples)
Each parameter costs half a log2(n) term rather than a full one.
Hint
The half-log penalty matches the BIC complexity term up to constants.
Test cases
case 1
in: [10,8,2]
expected: 13
case 2
in: [0,1,1]
expected: 0
case 3
in: [5,16,3]
expected: 11
case 4
in: [8,10,2]
expected: 11.321928094887362
Starter codePython
import math
def mdl_crude_two_part(nll_bits, n_samples, n_params):
# Your code here
pass4 test cases · run your code against them in the editor