class_docstr: Compute an incremental non-normalized (i.e., without z-normalization) matrix profile
  for streaming data
  
  Parameters
  ----------
  T : numpy.ndarray
      The time series or sequence for which the non-normalized matrix profile and
      matrix profile indices will be returned
  
  m : int
      Window size
  
  egress : bool, default True
      If set to `True`, the oldest data point in the time series is removed and
      the time series length remains constant rather than forever increasing
  
  p : float, default 2.0
      The p-norm to apply for computing the Minkowski distance.
  
  k : int, default 1
      The number of top `k` smallest distances used to construct the matrix profile.
      Note that this will increase the total computational time and memory usage
      when k > 1.
  
  mp : numpy.ndarry, default None
      A pre-computed matrix profile (and corresponding matrix profile indices).
      This is a 2D array of shape `(len(T) - m + 1, 2 * k + 2)`, where the first `k`
      columns are top-k matrix profile, and the next `k` columns are their
      corresponding indices. The last two columns correspond to the top-1 left and
      top-1 right matrix profile indices. When None (default), this array is computed
      internally using `stumpy.aamp`.
  
  Attributes
  ----------
  P_ : numpy.ndarray
      The updated matrix profile for `T`
  
  I_ : numpy.ndarray
      The updated matrix profile indices for `T`
  
  left_P_ : numpy.ndarray
      The updated left matrix profile for `T`
  
  left_I_ : numpy.ndarray
      The updated left matrix profile indices for `T`
  
  T_ : numpy.ndarray
      The updated time series or sequence for which the matrix profile and matrix
      profile indices are computed
  
  Methods
  -------
  update(t)
      Append a single new data point, `t`, to the time series, `T`, and update the
      matrix profile
  
  Notes
  -----
  `arXiv:1901.05708     <https://arxiv.org/pdf/1901.05708.pdf>`__
  
  See Algorithm 1
  
  Note that we have extended this algorithm for AB-joins as well.
class_docstr_tok: ["Compute","an","incremental","non-normalized","(","i.e.",",","without","z-normalization",")","matrix","profile","for","streaming","data","Parameters","--","--","--","--","--","T",":","numpy.ndarray","The","time","series","or","sequence","for","which","the","non-normalized","matrix","profile","and","matrix","profile","indices","will","be","returned","m",":","int","Window","size","egress",":","bool",",","default","True","If","set","to","`","True","`",",","the","oldest","data","point","in","the","time","series","is","removed","and","the","time","series","length","remains","constant","rather","than","forever","increasing","p",":","float",",","default","2.0","The","p-norm","to","apply","for","computing","the","Minkowski","distance",".","k",":","int",",","default","1","The","number","of","top","`","k","`","smallest","distances","used","to","construct","the","matrix","profile",".","Note","that","this","will","increase","the","total","computational","time","and","memory","usage","when","k",">","1.","mp",":","numpy.ndarry",",","default","None","A","pre-computed","matrix","profile","(","and","corresponding","matrix","profile","indices",")",".","This","is","a","2D","array","of","shape","`","(","len","(","T",")","-","m","+","1",",","2","*","k","+","2",")","`",",","where","the","first","`","k","`","columns","are","top-k","matrix","profile",",","and","the","next","`","k","`","columns","are","their","corresponding","indices",".","The","last","two","columns","correspond","to","the","top-1","left","and","top-1","right","matrix","profile","indices",".","When","None","(","default",")",",","this","array","is","computed","internally","using","`","stumpy.aamp","`",".","Attributes","--","--","--","--","--","P_",":","numpy.ndarray","The","updated","matrix","profile","for","`","T","`","I_",":","numpy.ndarray","The","updated","matrix","profile","indices","for","`","T","`","left_P_",":","numpy.ndarray","The","updated","left","matrix","profile","for","`","T","`","left_I_",":","numpy.ndarray","The","updated","left","matrix","profile","indices","for","`","T","`","T_",":","numpy.ndarray","The","updated","time","series","or","sequence","for","which","the","matrix","profile","and","matrix","profile","indices","are","computed","Methods","--","--","--","-","update","(","t",")","Append","a","single","new","data","point",",","`","t","`",",","to","the","time","series",",","`","T","`",",","and","update","the","matrix","profile","Notes","--","--","-","`","arXiv:1901.05708","<","https",":","\/\/arxiv.org\/pdf\/1901.05708.pdf",">","`","__","See","Algorithm","1","Note","that","we","have","extended","this","algorithm","for","AB-joins","as","well","."]
docstr: Initialize the `aampi` object
  
  Parameters
  ----------
  T : numpy.ndarray
      The time series or sequence for which the unnormalized matrix profile and
      matrix profile indices will be returned
  
  m : int
      Window size
  
  egress : bool, default True
      If set to `True`, the oldest data point in the time series is removed and
      the time series length remains constant rather than forever increasing
  
  p : float, default 2.0
      The p-norm to apply for computing the Minkowski distance.
  
  k : int, default 1
      The number of top `k` smallest distances used to construct the matrix
      profile. Note that this will increase the total computational time and
      memory usage when k > 1.
  
  mp : numpy.ndarry, default None
      A pre-computed matrix profile (and corresponding matrix profile indices).
      This is a 2D array of shape `(len(T) - m + 1, 2 * k + 2)`, where the first
      `k` columns are top-k matrix profile, and the next `k` columns are their
      corresponding indices. The last two columns correspond to the top-1 left
      and top-1 right matrix profile indices. When None (default), this array is
      computed internally using `stumpy.aamp`.
docstr_tok: ["Initialize","the","`","aampi","`","object","Parameters","--","--","--","--","--","T",":","numpy.ndarray","The","time","series","or","sequence","for","which","the","unnormalized","matrix","profile","and","matrix","profile","indices","will","be","returned","m",":","int","Window","size","egress",":","bool",",","default","True","If","set","to","`","True","`",",","the","oldest","data","point","in","the","time","series","is","removed","and","the","time","series","length","remains","constant","rather","than","forever","increasing","p",":","float",",","default","2.0","The","p-norm","to","apply","for","computing","the","Minkowski","distance",".","k",":","int",",","default","1","The","number","of","top","`","k","`","smallest","distances","used","to","construct","the","matrix","profile",".","Note","that","this","will","increase","the","total","computational","time","and","memory","usage","when","k",">","1.","mp",":","numpy.ndarry",",","default","None","A","pre-computed","matrix","profile","(","and","corresponding","matrix","profile","indices",")",".","This","is","a","2D","array","of","shape","`","(","len","(","T",")","-","m","+","1",",","2","*","k","+","2",")","`",",","where","the","first","`","k","`","columns","are","top-k","matrix","profile",",","and","the","next","`","k","`","columns","are","their","corresponding","indices",".","The","last","two","columns","correspond","to","the","top-1","left","and","top-1","right","matrix","profile","indices",".","When","None","(","default",")",",","this","array","is","computed","internally","using","`","stumpy.aamp","`","."]
code: def __init__(self, T, m, egress=True, p=2.0, k=1, mp=None):
      """
      Initialize the `aampi` object
  
      Parameters
      ----------
      T : numpy.ndarray
          The time series or sequence for which the unnormalized matrix profile and
          matrix profile indices will be returned
  
      m : int
          Window size
  
      egress : bool, default True
          If set to `True`, the oldest data point in the time series is removed and
          the time series length remains constant rather than forever increasing
  
      p : float, default 2.0
          The p-norm to apply for computing the Minkowski distance.
  
      k : int, default 1
          The number of top `k` smallest distances used to construct the matrix
          profile. Note that this will increase the total computational time and
          memory usage when k > 1.
  
      mp : numpy.ndarry, default None
          A pre-computed matrix profile (and corresponding matrix profile indices).
          This is a 2D array of shape `(len(T) - m + 1, 2 * k + 2)`, where the first
          `k` columns are top-k matrix profile, and the next `k` columns are their
          corresponding indices. The last two columns correspond to the top-1 left
          and top-1 right matrix profile indices. When None (default), this array is
          computed internally using `stumpy.aamp`.
      """
      self._T = core._preprocess(T)
      core.check_window_size(m, max_size=self._T.shape[-1])
      self._m = m
      self._n = self._T.shape[0]
      self._excl_zone = int(
          np.ceil(self._m / config.STUMPY_EXCL_ZONE_DENOM)
      )
      self._egress = egress
      self._p = p
      self._k = k
  
      if mp is None:
          mp = aamp(self._T, self._m, p=self._p, k=self._k)
      else:
          mp = mp.copy()
  
      if mp.shape != (
          len(self._T) - self._m + 1,
          2 * self._k + 2,
      ):  # pragma: no cover
          msg = (
              f"The shape of `mp` must match ({len(T)-m+1}, {2 * k + 2}) but "
              + f"found {mp.shape} instead."
          )
          raise ValueError(msg)
  
      self._P = mp[:, : self._k].astype(np.float64)
      self._I = mp[:, self._k : 2 * self._k].astype(np.int64)
      self._left_I = mp[:, 2 * self._k].astype(np.int64)
      self._left_P = np.full_like(
          self._left_I, np.inf, dtype=np.float64
      )
      self._left_P[:] = np.inf
  
      self._T_isfinite = np.isfinite(self._T)
      self._T, self._T_subseq_isfinite = core.preprocess_non_normalized(
          self._T, self._m
      )
  
      # Retrieve the left matrix profile values
  
      # Since each matrix profile value is the minimum between the left and right
      # matrix profile values, we can save time by re-computing only the left matrix
      # profile value when the matrix profile index is equal to the right matrix
      # profile index.
      mask = self._left_I == self._I[:, 0]
      self._left_P[mask] = self._P[mask, 0]
  
      # Only re-compute the `i`-th left matrix profile value, `self._left_P[i]`,
      # when `self._I[i] != self._left_I[i]`
      for i in np.flatnonzero(self._left_I >= 0 & ~mask):
          j = self._left_I[i]
          if j >= 0:
              self._left_P[i] = np.linalg.norm(
                  self._T[i : i + self._m] - self._T[j : j + self._m],
                  ord=self._p,
              )
  
      Q = self._T[-self._m :]
      self._p_norm = (
          core.mass_absolute(Q, self._T, p=self._p) ** self._p
      )
      if self._egress:
          self._p_norm_new = np.empty(
              self._p_norm.shape[0], dtype=np.float64
          )
          self._n_appended = 0
  
file_path: stumpy/stumpy/aampi.py
imports: import numpy
  from .None import config, core
  from .aamp import aamp
label_desc: Use image node_id 1 to create a new aampi object  with example: obj = aampi(T, m, egress, p, k, mp)