class_docstr: Computes the exponential moving average (normalized or un-normalized) of the
  time series, with smoothing factor alpha (lower alpha = more smoothing).
  alpha must be between 0 and 1.
  
  The unnormalized moving average ``y`` of ``x`` is computed as
  
  .. math::
      \begin{align*}
      y_0 & = x_0 \\
      y_i & = (1 - \alpha) \cdot y_{i-1} + \alpha \cdot x_i
      \end{align*}
  
  The normalized moving average ``y`` of ``x`` is computed as
  
  .. math::
  
      y_i = \frac{x_i + (1 - \alpha) x_{i-1} + \ldots + (1 - \alpha)^i x_0}
      {1 + (1 - \alpha) + \ldots + (1 - \alpha)^i}
  
  Upper and lower confidence bounds, ``l`` and ``u``, of the exponential moving
  average are computed using the exponential moving standard deviation, ``s``, and ``y`` as
  
  .. math::
      l_i = y_i + z_{\frac{1}{2} (1-p)} \times s_i \\
      u_i = u_o + z_{\frac{1}{2} (1+p)} \times s_i
  
  If condfidence bounds are included, the returned time series will contain
  the upper and lower bounds as additional univariates. For example if the 
  transform is applied to a time series with two univariates "x" and "y", 
  the resulting time series will contain univariates with the following names:
  "x", "x_lb", "x_ub", "y", "y_lb", "y_ub".
class_docstr_tok: ["Computes","the","exponential","moving","average","(","normalized","or","un-normalized",")","of","the","time","series",",","with","smoothing","factor","alpha","(","lower","alpha","=","more","smoothing",")",".","alpha","must","be","between","0","and","1",".","The","unnormalized","moving","average","``","y","``","of","``","x","``","is","computed","as","..","math",":",":","\\begin","{","align","*","}","y_0","&","=","x_0","\\\\","y_i","&","=","(","1","-","\\alpha",")","\\cdot","y_","{","i-1","}","+","\\alpha","\\cdot","x_i","\\end","{","align","*","}","The","normalized","moving","average","``","y","``","of","``","x","``","is","computed","as","..","math",":",":","y_i","=","\\frac","{","x_i","+","(","1","-","\\alpha",")","x_","{","i-1","}","+","\\ldots","+","(","1","-","\\alpha",")","^i","x_0","}","{","1","+","(","1","-","\\alpha",")","+","\\ldots","+","(","1","-","\\alpha",")","^i","}","Upper","and","lower","confidence","bounds",",","``","l","``","and","``","u","``",",","of","the","exponential","moving","average","are","computed","using","the","exponential","moving","standard","deviation",",","``","s","``",",","and","``","y","``","as","..","math",":",":","l_i","=","y_i","+","z_","{","\\frac","{","1","}","{","2","}","(","1-p",")","}","\\times","s_i","\\\\","u_i","=","u_o","+","z_","{","\\frac","{","1","}","{","2","}","(","1+p",")","}","\\times","s_i","If","condfidence","bounds","are","included",",","the","returned","time","series","will","contain","the","upper","and","lower","bounds","as","additional","univariates",".","For","example","if","the","transform","is","applied","to","a","time","series","with","two","univariates","``","x","''","and","``","y","''",",","the","resulting","time","series","will","contain","univariates","with","the","following","names",":","''","x","''",",","``","x_lb","''",",","``","x_ub","''",",","``","y","''",",","``","y_lb","''",",","``","y_ub","''","."]
code: def __call__(self, time_series: TimeSeries) -> TimeSeries:
      new_vars = OrderedDict()
      for name, var in time_series.items():
          emw = var.to_pd().ewm(alpha=self.alpha, adjust=self.normalize)
          ema = emw.mean()
          new_vars[name] = UnivariateTimeSeries.from_pd(ema)
          if self.ci:
              ems = emw.std()
              ems[0] = ems[1]
              new_vars[f"{name}_lb"] = UnivariateTimeSeries.from_pd(
                  ema + norm.ppf(0.5 * (1 - self.p)) * ems
              )
              new_vars[f"{name}_ub"] = UnivariateTimeSeries.from_pd(
                  ema + norm.ppf(0.5 * (1 + self.p)) * ems
              )
  
      ret = TimeSeries(new_vars, check_aligned=False)
      ret._is_aligned = time_series.is_aligned
      return ret
  
imports: from collections import OrderedDict
  import logging
  from typing import Sequence
  import numpy
  import scipy.signal
  from scipy.stats import norm
  from merlion.transform.base import TransformBase, InvertibleTransformBase
  from merlion.utils import UnivariateTimeSeries, TimeSeries
label_desc: Use image node_id 4 for calling the ExponentialMovingAverage obj's underlying member method code with example usage: obj.__call__(time_series) and returns: ret