Skip to content

Instantly share code, notes, and snippets.

@maxmouchet
Created June 12, 2019 11:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxmouchet/78ce5c72bbaf8c1f026239979023b1ad to your computer and use it in GitHub Desktop.
Save maxmouchet/78ce5c72bbaf8c1f026239979023b1ad to your computer and use it in GitHub Desktop.
def penalty(β):
"""
L: log-likelihood
n: number of data points
k: number of parameters
"""
return lambda L, n, k: β(n)*k - 2*L
AIC = penalty(lambda n: 2)
BIC = penalty(lambda n: np.log(n))
HQC = penalty(lambda n: 2*np.log(np.log(n)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment