code: def _get_par_summary(sim, n, probs):
      
      # _get_samples gets chains for nth parameter
      ss = _get_samples(n, sim, inc_warmup=False)
      msdfun = lambda chain: (np.mean(chain), np.std(chain, ddof=1))
      qfun = lambda chain: mquantiles(chain, probs)
      c_msd = np.array([msdfun(s) for s in ss]).flatten()
      c_quan = np.array([qfun(s) for s in ss]).flatten()
      ass = np.asarray(ss).flatten()
      msd = np.asarray(msdfun(ass))
      quan = qfun(np.asarray(ass))
      return dict(msd=msd, quan=quan, c_msd=c_msd, c_quan=c_quan)
docs: Summarize chains merged and individually
  
      Parameters
      ----------
      sim : dict from stanfit object
      n : int
          parameter index
      probs : iterable of int
          quantiles
  
      Returns
      -------
      summary : dict
         Dictionary containing summaries