code: def cum2mc(kappa):
      """convert non-central moments to cumulants
      recursive formula produces as many cumulants as moments
  
      References
      ----------
      Kenneth Lange: Numerical Analysis for Statisticians, page 40
      """
      X = _convert_to_multidim(kappa)
  
      def _local_counts(kappa):
          mc = [1, 0.0]  # _kappa[0]]  #insert 0-moment and mean
          kappa0 = kappa[0]
          kappa = [1] + list(kappa)
          for nn, m in enumerate(kappa[2:]):
              n = nn + 2
              mc.append(0)
              for k in range(n - 1):
                  mc[n] += (
                      comb(n - 1, k, exact=True) * kappa[n - k] * mc[k]
                  )
          mc[1] = kappa0  # insert mean as first moments by convention
          return mc[1:]
  
      res = np.apply_along_axis(_local_counts, 0, X)
      # for backward compatibility convert 1-dim output to list/tuple
      return _convert_from_multidim(res)
  
file_path: statsmodels/statsmodels/stats/moment_helpers.py
imports: import numpy
  from scipy.special import comb
label_desc: Use image node_id 5 for calling a global function with example usage: cum2mc(kappa) and returns: _convert_from_multidim, mc