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: Compute CRPS in analytical form for left/right tails
  Parameters
  ----------
  z
      Observation to evaluate. shape = (*batch_shape,)
  left_tail
      If True, compute CRPS for the left tail
      Otherwise, compute CRPS for the right tail
  Returns
  -------
  Tensor
      Tensor containing the CRPS, of the same shape as z
docstr_tok: ["Compute","CRPS","in","analytical","form","for","left\/right","tails","Parameters","--","--","--","--","--","z","Observation","to","evaluate",".","shape","=","(","*","batch_shape",",",")","left_tail","If","True",",","compute","CRPS","for","the","left","tail","Otherwise",",","compute","CRPS","for","the","right","tail","Returns","--","--","--","-","Tensor","Tensor","containing","the","CRPS",",","of","the","same","shape","as","z"]
code: def crps_tail(
      self, z: torch.Tensor, left_tail: bool = True
  ) -> torch.Tensor:
      r"""
      Compute CRPS in analytical form for left/right tails
      Parameters
      ----------
      z
          Observation to evaluate. shape = (*batch_shape,)
      left_tail
          If True, compute CRPS for the left tail
          Otherwise, compute CRPS for the right tail
      Returns
      -------
      Tensor
          Tensor containing the CRPS, of the same shape as z
      """
  
      alpha_tilde = self.cdf_tail(z, left_tail=left_tail)
  
      if left_tail:
          tail_a, tail_b, qk_x, qk_y = (
              self.tail_al,
              self.tail_bl,
              self.qk_x_l,
              self.qk_y_l,
          )
          term1 = (z - tail_b) * (
              qk_x**2 - 2 * qk_x + 2 * alpha_tilde
          )
          term2 = qk_x**2 * tail_a * (-torch.log(qk_x) + 0.5)
          term2 = term2 + 2 * torch.where(
              z < qk_y,
              qk_x * tail_a * (torch.log(qk_x) - 1)
              + alpha_tilde * (-z + tail_b + tail_a),
              torch.zeros_like(qk_x),
          )
      else:
          tail_a, tail_b, qk_x, qk_y = (
              self.tail_ar,
              self.tail_br,
              self.qk_x_r,
              self.qk_y_r,
          )
          term1 = (z - tail_b) * (-1 - qk_x**2 + 2 * alpha_tilde)
          term2 = tail_a * (
              -0.5 * (qk_x + 1) ** 2
              + (qk_x**2 - 1) * torch.log(1 - qk_x)
              + 2 * alpha_tilde
          )
          term2 = term2 + 2 * torch.where(
              z > qk_y,
              (1 - alpha_tilde) * (z - tail_b),
              tail_a * (1 - qk_x) * torch.log(1 - qk_x),
          )
  
      return term1 + term2
  
imports: from typing import Dict, List, Optional, Tuple
  import torch
  import torch.nn.functional
  from torch.distributions import AffineTransform, TransformedDistribution
  from gluonts.core.component import validated
  from .distribution_output import DistributionOutput
label_desc: Use image node_id 11 for calling the ISQF obj's underlying member method code with example usage: obj.crps_tail(z, left_tail) and returns: unknown