class_docstr: Spliced Binned-Pareto univariate distribution.
  
  Arguments
  ----------
  bins_lower_bound: The lower bound of the bin edges
  bins_upper_bound: The upper bound of the bin edges
  nbins: The number of equidistance bins to allocate between `bins_lower_bound` and `bins_upper_bound`. Default value is 100.
  percentile_gen_pareto: The percentile of the distribution that is each tail. Default value is 0.05. NB: This symmetric percentile can still represent asymmetric upper and lower tails.
docstr: Cumulative density for one datapoint `xx`, where `cum_density` is the
  cdf up to bin_edges `idx` which must be lower than `xx`
docstr_tok: ["Cumulative","density","for","one","datapoint","`","xx","`",",","where","`","cum_density","`","is","the","cdf","up","to","bin_edges","`","idx","`","which","must","be","lower","than","`","xx","`"]
code: def cdf_components(self, xx, idx=0, cum_density=torch.tensor([0.0])):
      """
      Cumulative density for one datapoint `xx`, where `cum_density` is the
      cdf up to bin_edges `idx` which must be lower than `xx`
      """
      bin_cdf_relative = torch.tensor([0.0])
      upper_percentile = self.icdf(1 - self.percentile_gen_pareto)
      lower_percentile = self.icdf(self.percentile_gen_pareto)
      if xx < lower_percentile:
          adjusted_xx = lower_percentile - xx
          cum_density = (
              1.0 - self.lower_gen_pareto.cdf(adjusted_xx)
          ) * self.percentile_gen_pareto
      elif xx <= upper_percentile:
          (
              idx,
              cum_density,
              bin_cdf_relative,
          ) = self.cdf_binned_components(xx, idx, cum_density)
      else:
          adjusted_xx = xx - upper_percentile
          cum_density = (
              1.0 - self.percentile_gen_pareto
          ) + self.upper_gen_pareto.cdf(
              adjusted_xx
          ) * self.percentile_gen_pareto
      return idx, cum_density, bin_cdf_relative
  
imports: from typing import Optional
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  import torch.optim
  from .genpareto import GenPareto
label_desc: Use image node_id 5 for calling the SplicedBinnedPareto obj's underlying member method code with example usage: obj.cdf_components(xx, idx, cum_density) and returns: idx,  cum_density,  bin_cdf_relative