def _log_wishart_const(num_features, nws_dof, nws_scale_matrix): """Compute `log_wishart_const_init` """ log_wishart_const = ((nws_dof / 2) * logdet(nws_scale_matrix) - (nws_dof * num_features / 2) * log(2) - mvt_gamma_ln(num_features, nws_dof / 2)) return log_wishart_const
def _log_wishart_const(num_features, nws_dof, nws_scale_matrix): """Compute `log_wishart_const_init` """ if nws_scale_matrix.ndim == 2: ld = logdet(nws_scale_matrix) else: ld = [logdet(nws_scale_matrix[k, :, :]) for k in range(nws_scale_matrix.shape[0])] log_wishart_const = ( (nws_dof / 2) * ld - (nws_dof * num_features / 2) * log(2) - mvt_gamma_ln(num_features, nws_dof / 2) ) return log_wishart_const