All problems
BIC Prior Term
Problem
Return the parameter-complexity term of the Bayesian information criterion:
penalty = k * ln(n)
where k is the number of parameters and n the number of samples. This term approximates the volume of the parameter prior.
Hint
Unlike AIC, the BIC penalty grows with the sample size.
Test cases
case 1
in: [1,8]
expected: 2.0794415416798357
case 2
in: [2,16]
expected: 5.545177444479562
case 3
in: [3,100]
expected: 13.815510557964275
case 4
in: [0,10]
expected: 0
Starter codePython
import math
def bic_prior_term(k, n):
# Your code here
pass4 test cases · run your code against them in the editor