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
      numb_bins: The number of equidistance bins to allocate between
          `bins_lower_bound` and `bins_upper_bound`. Default value is 100.
      tail_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.
class_docstr_tok: ["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","numb_bins",":","The","number","of","equidistance","bins","to","allocate","between","`","bins_lower_bound","`","and","`","bins_upper_bound","`",".","Default","value","is","100.","tail_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 tensor for a tensor of data points `x`.
  'x' is expected to be of shape (*batch_shape)
docstr_tok: ["Cumulative","density","tensor","for","a","tensor","of","data","points","`","x","`",".","'","x","'","is","expected","to","be","of","shape","(","*","batch_shape",")"]
code: def cdf(self, x: torch.Tensor):
      """
      Cumulative density tensor for a tensor of data points `x`.
      'x' is expected to be of shape (*batch_shape)
      """
      for i in range(0, len(x.shape)):
          assert (
              x.shape[i] == self.batch_shape[i]
          ), "We expect the input to be a tensor of size batch_shape"
  
      lower_percentile_value = self.icdf(
          self.tail_percentile_gen_pareto
      )
      upper_percentile_value = self.icdf(
          1 - self.tail_percentile_gen_pareto
      )
  
      # The cdf of the main distribution body:
      cdf_body = self._cdf_binned(x)
  
      # The cdf for the lower tail:
      adjusted_x_for_lower = lower_percentile_value - x
      cdf_lower = (
          1.0 - self.lower_gen_pareto.cdf(adjusted_x_for_lower)
      ) * self.tail_percentile_gen_pareto
  
      # The cdf for the upper tail:
      adjusted_x_for_upper = x - upper_percentile_value
      cdf_upper = self.upper_gen_pareto.cdf(
          adjusted_x_for_upper
      ) * self.tail_percentile_gen_pareto + (
          1 - self.tail_percentile_gen_pareto
      )
  
      # Putting them together:
      cdf_value = cdf_body
  
      cdf_value = torch.where(
          x < lower_percentile_value, cdf_lower, cdf_value
      )
  
      cdf_value = torch.where(
          x > upper_percentile_value,
          cdf_upper,
          cdf_value,
      )
      return cdf_value
  
file_path: gluonts/src/gluonts/torch/distributions/spliced_binned_pareto.py
imports: from typing import Dict, Optional, Tuple, cast
  import torch
  from torch.distributions import constraints
  from gluonts.core.component import validated
  from gluonts.torch.distributions import BinnedUniforms, GeneralizedPareto
  from .distribution_output import DistributionOutput
label_desc: Use image node_id 5 for calling the SplicedBinnedPareto obj's underlying member method code with example usage: obj.cdf(x) and returns: cdf_value