class_docstr: Edit distance for real sequences (EDR) between two time series.
  
  ERP was adapted in [1] specifically for distances between trajectories. Like LCSS,
  EDR uses a distance threshold to define when two elements of a series match.
  However, rather than simply count matches and look for the longest sequence,
  ERP applies a (constant) penalty for non-matching elements
  where gaps are inserted to create an optimal alignment.
  
  References
  ----------
  .. [1] Chen L, Ozsu MT, Oria V: Robust and fast similarity search for moving
  object trajectories. In: Proceedings of the ACM SIGMOD International Conference
  on Management of Data, 2005
docstr: Create a no_python compiled edr distance callable.
  
  Series should be shape (d, m), where d is the number of dimensions, m the series
  length. Series can be different lengths.
  
  Parameters
  ----------
  x: np.ndarray (2d array of shape (d,m1)).
      First time series.
  y: np.ndarray (2d array of shape (d,m2)).
      Second time series.
  window: float, defaults = None
      Float that is the radius of the sakoe chiba window (if using Sakoe-Chiba
      lower bounding). Must be between 0 and 1.
  itakura_max_slope: float, defaults = None
      Gradient of the slope for itakura parallelogram (if using Itakura
      Parallelogram lower bounding). Must be between 0 and 1.
  bounding_matrix: np.ndarray (2d array of shape (m1,m2)), defaults = None
      Custom bounding matrix to use. If defined then other lower_bounding params
      are ignored. The matrix should be structure so that indexes considered in
      bound should be the value 0. and indexes outside the bounding matrix should
      be infinity.
  epsilon : float, defaults = None
      Matching threshold to determine if two subsequences are considered close
      enough to be considered 'common'. If not specified as per the original paper
      epsilon is set to a quarter of the maximum standard deviation.
  kwargs: Any
      Extra kwargs.
  
  Returns
  -------
  Callable[[np.ndarray, np.ndarray], float]
      No_python compiled edr distance callable.
  
  Raises
  ------
  ValueError
      If the input time series are not numpy array.
      If the input time series do not have exactly 2 dimensions.
      If the sakoe_chiba_window_radius is not an integer.
      If the itakura_max_slope is not a float or int.
      If epsilon is not a float.
docstr_tok: ["Create","a","no_python","compiled","edr","distance","callable",".","Series","should","be","shape","(","d",",","m",")",",","where","d","is","the","number","of","dimensions",",","m","the","series","length",".","Series","can","be","different","lengths",".","Parameters","--","--","--","--","--","x",":","np.ndarray","(","2d","array","of","shape","(","d",",","m1",")",")",".","First","time","series",".","y",":","np.ndarray","(","2d","array","of","shape","(","d",",","m2",")",")",".","Second","time","series",".","window",":","float",",","defaults","=","None","Float","that","is","the","radius","of","the","sakoe","chiba","window","(","if","using","Sakoe-Chiba","lower","bounding",")",".","Must","be","between","0","and","1.","itakura_max_slope",":","float",",","defaults","=","None","Gradient","of","the","slope","for","itakura","parallelogram","(","if","using","Itakura","Parallelogram","lower","bounding",")",".","Must","be","between","0","and","1.","bounding_matrix",":","np.ndarray","(","2d","array","of","shape","(","m1",",","m2",")",")",",","defaults","=","None","Custom","bounding","matrix","to","use",".","If","defined","then","other","lower_bounding","params","are","ignored",".","The","matrix","should","be","structure","so","that","indexes","considered","in","bound","should","be","the","value","0.","and","indexes","outside","the","bounding","matrix","should","be","infinity",".","epsilon",":","float",",","defaults","=","None","Matching","threshold","to","determine","if","two","subsequences","are","considered","close","enough","to","be","considered","'common","'",".","If","not","specified","as","per","the","original","paper","epsilon","is","set","to","a","quarter","of","the","maximum","standard","deviation",".","kwargs",":","Any","Extra","kwargs",".","Returns","--","--","--","-","Callable","[","[","np.ndarray",",","np.ndarray","]",",","float","]","No_python","compiled","edr","distance","callable",".","Raises","--","--","--","ValueError","If","the","input","time","series","are","not","numpy","array",".","If","the","input","time","series","do","not","have","exactly","2","dimensions",".","If","the","sakoe_chiba_window_radius","is","not","an","integer",".","If","the","itakura_max_slope","is","not","a","float","or","int",".","If","epsilon","is","not","a","float","."]
code: def _distance_factory(
      self,
      x: np.ndarray,
      y: np.ndarray,
      window: float = None,
      itakura_max_slope: float = None,
      bounding_matrix: np.ndarray = None,
      epsilon: float = None,
      **kwargs: Any,
  ) -> DistanceCallable:
      """Create a no_python compiled edr distance callable.
  
      Series should be shape (d, m), where d is the number of dimensions, m the series
      length. Series can be different lengths.
  
      Parameters
      ----------
      x: np.ndarray (2d array of shape (d,m1)).
          First time series.
      y: np.ndarray (2d array of shape (d,m2)).
          Second time series.
      window: float, defaults = None
          Float that is the radius of the sakoe chiba window (if using Sakoe-Chiba
          lower bounding). Must be between 0 and 1.
      itakura_max_slope: float, defaults = None
          Gradient of the slope for itakura parallelogram (if using Itakura
          Parallelogram lower bounding). Must be between 0 and 1.
      bounding_matrix: np.ndarray (2d array of shape (m1,m2)), defaults = None
          Custom bounding matrix to use. If defined then other lower_bounding params
          are ignored. The matrix should be structure so that indexes considered in
          bound should be the value 0. and indexes outside the bounding matrix should
          be infinity.
      epsilon : float, defaults = None
          Matching threshold to determine if two subsequences are considered close
          enough to be considered 'common'. If not specified as per the original paper
          epsilon is set to a quarter of the maximum standard deviation.
      kwargs: Any
          Extra kwargs.
  
      Returns
      -------
      Callable[[np.ndarray, np.ndarray], float]
          No_python compiled edr distance callable.
  
      Raises
      ------
      ValueError
          If the input time series are not numpy array.
          If the input time series do not have exactly 2 dimensions.
          If the sakoe_chiba_window_radius is not an integer.
          If the itakura_max_slope is not a float or int.
          If epsilon is not a float.
      """
      from sktime.distances._edr_numba import _edr_cost_matrix
      from sktime.distances.lower_bounding import (
          resolve_bounding_matrix,
      )
      from sktime.utils.numba.njit import njit
  
      _bounding_matrix = resolve_bounding_matrix(
          x, y, window, itakura_max_slope, bounding_matrix
      )
  
      if epsilon is not None and not isinstance(epsilon, float):
          raise ValueError("The value of epsilon must be a float.")
  
      @njit(cache=True)
      def numba_edr_distance(_x: np.ndarray, _y: np.ndarray) -> float:
          if np.array_equal(_x, _y):
              return 0.0
          if epsilon is None:
              _epsilon = max(np.std(_x), np.std(_y)) / 4
          else:
              _epsilon = epsilon
          cost_matrix = _edr_cost_matrix(
              _x, _y, _bounding_matrix, _epsilon
          )
          return float(
              cost_matrix[-1, -1] / max(_x.shape[1], _y.shape[1])
          )
  
      return numba_edr_distance
  
imports: from typing import Any, List, Tuple
  import numpy
  from sktime.distances.base import DistanceAlignmentPathCallable, DistanceCallable, NumbaDistance
label_desc: Use image node_id 2 for calling the _EdrDistance obj's underlying member method code with example usage: obj._distance_factory(x, y, window, itakura_max_slope, bounding_matrix, epsilon) and returns: numba_edr_distance, float, int