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 the spline
  Parameters
  ----------
  z
      Observation to evaluate. shape = (*batch_shape,)
  Returns
  -------
  Tensor
      Tensor containing the CRPS, of the same shape as z
code: def crps_spline(self, z: Tensor) -> Tensor:
      r"""
      Compute CRPS in analytical form for the spline
      Parameters
      ----------
      z
          Observation to evaluate. shape = (*batch_shape,)
      Returns
      -------
      Tensor
          Tensor containing the CRPS, of the same shape as z
      """
  
      F = self.F
      qk_x, qk_x_plus, qk_y = self.qk_x, self.qk_x_plus, self.qk_y
      sk_x, sk_x_plus = self.sk_x, self.sk_x_plus
      delta_sk_x, delta_sk_y = self.delta_sk_x, self.delta_sk_y
  
      z_expand, qk_x_plus_expand = (
          F.expand_dims(z, axis=-1),
          F.expand_dims(qk_x_plus, axis=-1),
      )
  
      alpha_tilde = self.cdf_spline(z)
      alpha_tilde_expand = F.expand_dims(alpha_tilde, axis=-1)
  
      r = F.broadcast_minimum(
          F.broadcast_maximum(alpha_tilde_expand, sk_x), sk_x_plus
      )
  
      coeff1 = (
          -2 / 3 * sk_x_plus**3
          + sk_x * sk_x_plus**2
          + sk_x_plus**2
          - (1 / 3) * sk_x**3
          - 2 * sk_x * sk_x_plus
          - r**2
          + 2 * sk_x * r
      )
  
      coeff2 = F.broadcast_add(
          -2 * F.broadcast_maximum(alpha_tilde_expand, sk_x_plus)
          + sk_x_plus**2,
          2 * qk_x_plus_expand - qk_x_plus_expand**2,
      )
  
      result = (
          (qk_x_plus**2 - qk_x**2) * F.broadcast_sub(z_expand, qk_y)
          + 2
          * F.broadcast_sub(qk_x_plus, alpha_tilde)
          * F.broadcast_sub(qk_y, z_expand)
          + F.sum(
              (delta_sk_y / delta_sk_x) * coeff1,
              axis=-1,
              keepdims=False,
          )
          + F.sum(delta_sk_y * coeff2, axis=-1, keepdims=False)
      )
  
      return F.sum(result, axis=-1, keepdims=False)
  
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 14 for calling the ISQF obj's underlying member method code with example usage: obj.crps_spline(z) and returns: F