code: def compute_bayes_cone(preds, starting_value=1.):
      
  
      def scoreatpercentile(cum_preds, p):
          return [stats.scoreatpercentile(
              c, p) for c in cum_preds.T]
  
      cum_preds = np.cumprod(preds + 1, 1) * starting_value
      perc = {p: scoreatpercentile(cum_preds, p) for p in (5, 25, 75, 95)}
  
      return perc
docs: Compute 5, 25, 75 and 95 percentiles of cumulative returns, used
      for the Bayesian cone.
  
      Parameters
      ----------
      preds : numpy.array
          Multiple (simulated) cumulative returns.
      starting_value : int (optional)
          Have cumulative returns start around this value.
          Default = 1.
  
      Returns
      -------
      dict of percentiles over time
          Dictionary mapping percentiles (5, 25, 75, 95) to a
          timeseries.