code: def kl_wishart_distribution(dof_q, scale_q, dof_p, scale_p):
      """
      KL Divergence between two Wishart Distributions
  
      q(x) = Wishart(R|dof_q, scale_q)
      p(x) = Wishart(R|dof_p, scale_p)
  
      Definition from:
          Shihao Ji, B. Krishnapuram, and L. Carin,
          "Variational Bayes for continuous hidden Markov models and its
          application to active learning," IEEE Transactions on Pattern
          Analysis and Machine Intelligence, vol. 28, no. 4, pp. 522–532,
          Apr. 2006, doi: 10.1109/TPAMI.2006.85.
      """
      scale_q = np.asarray(scale_q)
      scale_p = np.asarray(scale_p)
      D = scale_p.shape[0]
      return (
          (dof_q - dof_p) / 2 * _E(dof_q, scale_q)
          - D * dof_q / 2
          + dof_q / 2 * np.trace(scale_p @ np.linalg.inv(scale_q))
          # Division of logarithm turned into subtraction here
          + _logZ(dof_p, scale_p)
          - _logZ(dof_q, scale_q)
      )
  
file_path: hmmlearn/lib/hmmlearn/_kl_divergence.py
imports: import numpy
  from scipy.special import gammaln, digamma
  from .None import _utils
label_desc: Use image node_id 5 for calling a global function with example usage: kl_wishart_distribution(dof_q, scale_q, dof_p, scale_p) and returns: unknown