Rahul Suresh
Rahul Suresh

Reputation: 3

Bayesian Information Criterion based on non-negative matrix factorization (NMF)

How to calculate Log-Liklihood (L) and BIC from NMF results.

Shape of W (weights): (65537, 117) Shape of H (components): (117, 467)

I have used the following to calculate L

var = np.var(residuals, ddof=1)  # Use population variance if appropriate
log_likelihood = 0
for i in range(residuals.shape[0]):
    for j in range(residuals.shape[1]):
        log_likelihood += -0.5 * np.log(2 * np.pi * var) - (residuals[i, j]**2) / (2 * var)

However, I am unsure if the output value is correct as it is over 7 digits. Has anyone calculated BIC from NMF or other regression models?

Upvotes: 0

Views: 43

Answers (0)

Related Questions