class_docstr: Distribution class for the Incremental (Spline) Quantile Function in the
  paper ``Learning Quantile Functions without Quantile Crossing for
  Distribution-free Time Series Forecasting``
  by Park, Robinson, Aubet, Kan, Gasthaus, Wang
  
  Parameters
  ----------
  spline_knots, spline_heights
      Tensor parametrizing the x-positions (y-positions) of the spline knots
      Shape: (*batch_shape, (num_qk-1), num_pieces)
  qk_x, qk_y
      Tensor containing the increasing x-positions (y-positions) of the
      quantile knots, Shape: (*batch_shape, num_qk)
  beta_l, beta_r
      Tensor containing the non-negative learnable parameter of the
      left (right) tail, Shape: (*batch_shape,)
class_docstr_tok: ["Distribution","class","for","the","Incremental","(","Spline",")","Quantile","Function","in","the","paper","``","Learning","Quantile","Functions","without","Quantile","Crossing","for","Distribution-free","Time","Series","Forecasting","``","by","Park",",","Robinson",",","Aubet",",","Kan",",","Gasthaus",",","Wang","Parameters","--","--","--","--","--","spline_knots",",","spline_heights","Tensor","parametrizing","the","x-positions","(","y-positions",")","of","the","spline","knots","Shape",":","(","*","batch_shape",",","(","num_qk-1",")",",","num_pieces",")","qk_x",",","qk_y","Tensor","containing","the","increasing","x-positions","(","y-positions",")","of","the","quantile","knots",",","Shape",":","(","*","batch_shape",",","num_qk",")","beta_l",",","beta_r","Tensor","containing","the","non-negative","learnable","parameter","of","the","left","(","right",")","tail",",","Shape",":","(","*","batch_shape",",",")"]
docstr: Function to parametrize the tail parameters
  
  Note that the exponential tails are given by
  q(alpha)
  = a_l log(alpha) + b_l if left tail
  = a_r log(1-alpha) + b_r if right tail
  
  where
  a_l=1/beta_l, b_l=-a_l*log(qk_x_l)+q(qk_x_l)
  a_r=1/beta_r, b_r=a_r*log(1-qk_x_r)+q(qk_x_r)
  
  Parameters
  ----------
  beta
      parameterizes the left or right tail, shape: (*batch_shape,)
  qk_x
      left- or right-most x-positions of the quantile knots,
      shape: (*batch_shape,)
  qk_y
      left- or right-most y-positions of the quantile knots,
      shape: (*batch_shape,)
  Returns
  -------
  tail_a
      a_l or a_r as described above
  tail_b
      b_l or b_r as described above
code: def parametrize_tail(
      F, beta: Tensor, qk_x: Tensor, qk_y: Tensor
  ) -> Tuple[Tensor, Tensor]:
      r"""
      Function to parametrize the tail parameters
  
      Note that the exponential tails are given by
      q(alpha)
      = a_l log(alpha) + b_l if left tail
      = a_r log(1-alpha) + b_r if right tail
  
      where
      a_l=1/beta_l, b_l=-a_l*log(qk_x_l)+q(qk_x_l)
      a_r=1/beta_r, b_r=a_r*log(1-qk_x_r)+q(qk_x_r)
  
      Parameters
      ----------
      beta
          parameterizes the left or right tail, shape: (*batch_shape,)
      qk_x
          left- or right-most x-positions of the quantile knots,
          shape: (*batch_shape,)
      qk_y
          left- or right-most y-positions of the quantile knots,
          shape: (*batch_shape,)
      Returns
      -------
      tail_a
          a_l or a_r as described above
      tail_b
          b_l or b_r as described above
      """
  
      tail_a = 1 / beta
      tail_b = -tail_a * F.log(qk_x) + qk_y
  
      return tail_a, tail_b
  
imports: from typing import Dict, List, Optional, Tuple
  import numpy
  from gluonts.core.component import validated
  from gluonts.mx import Tensor
  from gluonts.mx.util import cumsum
  from .bijection import AffineTransformation, Bijection
  from .distribution import Distribution, getF
  from .distribution_output import DistributionOutput
  from .transformed_distribution import TransformedDistribution
label_desc: Use image node_id 6 for calling the ISQF obj's underlying member method code with example usage: obj.parametrize_tail(F, beta, qk_x, qk_y) and returns: tail_a,  tail_b