class_docstr: Marginal transformation that transforms the target via an empirical CDF to
  a standard gaussian as described here: https://arxiv.org/abs/1910.03002.
  
  To be used in conjunction with a multivariate gaussian to from a copula.
  Note that this transformation is currently intended for multivariate
  targets only.
class_docstr_tok: ["Marginal","transformation","that","transforms","the","target","via","an","empirical","CDF","to","a","standard","gaussian","as","described","here",":","https",":","\/\/arxiv.org\/abs\/1910.03002",".","To","be","used","in","conjunction","with","a","multivariate","gaussian","to","from","a","copula",".","Note","that","this","transformation","is","currently","intended","for","multivariate","targets","only","."]
docstr: Calculates the piece-wise linear parameters to interpolate between the
  observed values in the empirical CDF.
  
  Once current limitation is that we use a zero slope line as the last
  piece. Thus, we cannot forecast anything higher than the highest
  observed value.
  
  Parameters
  ----------
  data
      Input data entry containing a sorted target field.
  
  Returns
  -------
docstr_tok: ["Calculates","the","piece-wise","linear","parameters","to","interpolate","between","the","observed","values","in","the","empirical","CDF",".","Once","current","limitation","is","that","we","use","a","zero","slope","line","as","the","last","piece",".","Thus",",","we","can","not","forecast","anything","higher","than","the","highest","observed","value",".","Parameters","--","--","--","--","--","data","Input","data","entry","containing","a","sorted","target","field",".","Returns","--","--","--","-"]
code: def _calc_pw_linear_params(self, data: DataEntry):
      """
      Calculates the piece-wise linear parameters to interpolate between the
      observed values in the empirical CDF.
  
      Once current limitation is that we use a zero slope line as the last
      piece. Thus, we cannot forecast anything higher than the highest
      observed value.
  
      Parameters
      ----------
      data
          Input data entry containing a sorted target field.
  
      Returns
      -------
      """
      sorted_target = data[self.sort_target_field]
      sorted_target_length, target_dim = sorted_target.shape
  
      quantiles = np.stack(
          [np.arange(sorted_target_length) for _ in range(target_dim)],
          axis=1,
      ) / float(sorted_target_length)
  
      x_diff = np.diff(sorted_target, axis=0)
      y_diff = np.diff(quantiles, axis=0)
  
      # Calculate slopes of the pw-linear pieces.
      slopes = np.where(
          x_diff == 0.0, np.zeros_like(x_diff), y_diff / x_diff
      )
  
      zeroes = np.zeros_like(np.expand_dims(slopes[0, :], axis=0))
      slopes = np.append(slopes, zeroes, axis=0)
  
      # Calculate intercepts of the pw-linear pieces.
      intercepts = quantiles - slopes * sorted_target
  
      # Populate new fields with the piece-wise linear parameters.
      data[self.slopes_field] = slopes.astype(self.dtype)
      data[self.intercepts_field] = intercepts.astype(self.dtype)
  
imports: from typing import Callable, Iterator, List, Optional, Tuple, Type
  import numpy
  from toolz import valmap
  from gluonts.core.component import validated, tensor_to_numpy
  from gluonts.dataset.common import DataEntry
  from gluonts.exceptions import assert_data_error
  from ._base import FlatMapTransformation, MapTransformation, SimpleTransformation
label_desc: Use image node_id 4 for calling the CDFtoGaussianTransform obj's underlying member method code with example usage: obj._calc_pw_linear_params(data) without return types