class_docstr: Implements the Scaled Unscented Kalman filter (UKF) as defined by
  Simon Julier in [1], using the formulation provided by Wan and Merle
  in [2]. This filter scales the sigma points to avoid strong nonlinearities.
  
  
  You will have to set the following attributes after constructing this
  object for the filter to perform properly.
  
  Attributes
  ----------
  
  x : numpy.array(dim_x)
      state estimate vector
  
  P : numpy.array(dim_x, dim_x)
      covariance estimate matrix
  
  R : numpy.array(dim_z, dim_z)
      measurement noise matrix
  
  Q : numpy.array(dim_x, dim_x)
      process noise matrix
  
  
  You may read the following attributes.
  
  Readable Attributes
  -------------------
  
  
  K : numpy.array
      Kalman gain
  
  y : numpy.array
      innovation residual
  
  x : numpy.array(dim_x)
      predicted/updated state (result of predict()/update())
  
  P : numpy.array(dim_x, dim_x)
      predicted/updated covariance matrix (result of predict()/update())
  
  likelihood : scalar
      Likelihood of last measurement update.
  
  log_likelihood : scalar
      Log likelihood of last measurement update.
  
  
  References
  ----------
  
  .. [1] Julier, Simon J. "The scaled unscented transformation,"
      American Control Converence, 2002, pp 4555-4559, vol 6.
  
      Online copy:
      https://www.cs.unc.edu/~welch/kalman/media/pdf/ACC02-IEEE1357.PDF
  
  
  .. [2] E. A. Wan and R. Van der Merwe, “The unscented Kalman filter for
      nonlinear estimation,” in Proc. Symp. Adaptive Syst. Signal
      Process., Commun. Contr., Lake Louise, AB, Canada, Oct. 2000.
  
      Online Copy:
      https://www.seas.harvard.edu/courses/cs281/papers/unscented.pdf
class_docstr_tok: ["Implements","the","Scaled","Unscented","Kalman","filter","(","UKF",")","as","defined","by","Simon","Julier","in","[","1","]",",","using","the","formulation","provided","by","Wan","and","Merle","in","[","2","]",".","This","filter","scales","the","sigma","points","to","avoid","strong","nonlinearities",".","You","will","have","to","set","the","following","attributes","after","constructing","this","object","for","the","filter","to","perform","properly",".","Attributes","--","--","--","--","--","x",":","numpy.array","(","dim_x",")","state","estimate","vector","P",":","numpy.array","(","dim_x",",","dim_x",")","covariance","estimate","matrix","R",":","numpy.array","(","dim_z",",","dim_z",")","measurement","noise","matrix","Q",":","numpy.array","(","dim_x",",","dim_x",")","process","noise","matrix","You","may","read","the","following","attributes",".","Readable","Attributes","--","--","--","--","--","--","--","--","--","-","K",":","numpy.array","Kalman","gain","y",":","numpy.array","innovation","residual","x",":","numpy.array","(","dim_x",")","predicted\/updated","state","(","result","of","predict","(",")","\/update","(",")",")","P",":","numpy.array","(","dim_x",",","dim_x",")","predicted\/updated","covariance","matrix","(","result","of","predict","(",")","\/update","(",")",")","likelihood",":","scalar","Likelihood","of","last","measurement","update",".","log_likelihood",":","scalar","Log","likelihood","of","last","measurement","update",".","References","--","--","--","--","--","..","[","1","]","Julier",",","Simon","J",".","``","The","scaled","unscented","transformation",",","''","American","Control","Converence",",","2002",",","pp","4555-4559",",","vol","6",".","Online","copy",":","https",":","\/\/www.cs.unc.edu\/~welch\/kalman\/media\/pdf\/ACC02-IEEE1357.PDF","..","[","2","]","E.","A.","Wan","and","R.","Van","der","Merwe",",","\u201c","The","unscented","Kalman","filter","for","nonlinear","estimation",",","\u201d","in","Proc",".","Symp",".","Adaptive","Syst",".","Signal","Process.",",","Commun",".","Contr.",",","Lake","Louise",",","AB",",","Canada",",","Oct.","2000",".","Online","Copy",":","https",":","\/\/www.seas.harvard.edu\/courses\/cs281\/papers\/unscented.pdf"]
docstr: Performs the UKF filter over the list of measurement in `zs`.
  
  Parameters
  ----------
  
  zs : list-like
      list of measurements at each time step `self._dt` Missing
      measurements must be represented by 'None'.
  
  Rs : list-like, optional
      optional list of values to use for the measurement error
      covariance; a value of None in any position will cause the filter
      to use `self.R` for that time step.
  
  UT : function(sigmas, Wm, Wc, noise_cov), optional
      Optional function to compute the unscented transform for the sigma
      points passed through hx. Typically the default function will
      work - you can use x_mean_fn and z_mean_fn to alter the behavior
      of the unscented transform.
  
  Returns
  -------
  
  means: ndarray((n,dim_x,1))
      array of the state for each time step after the update. Each entry
      is an np.array. In other words `means[k,:]` is the state at step
      `k`.
  
  covariance: ndarray((n,dim_x,dim_x))
      array of the covariances for each time step after the update.
      In other words `covariance[k,:,:]` is the covariance at step `k`.
docstr_tok: ["Performs","the","UKF","filter","over","the","list","of","measurement","in","`","zs","`",".","Parameters","--","--","--","--","--","zs",":","list-like","list","of","measurements","at","each","time","step","`","self._dt","`","Missing","measurements","must","be","represented","by","'None","'",".","Rs",":","list-like",",","optional","optional","list","of","values","to","use","for","the","measurement","error","covariance",";","a","value","of","None","in","any","position","will","cause","the","filter","to","use","`","self.R","`","for","that","time","step",".","UT",":","function","(","sigmas",",","Wm",",","Wc",",","noise_cov",")",",","optional","Optional","function","to","compute","the","unscented","transform","for","the","sigma","points","passed","through","hx",".","Typically","the","default","function","will","work","-","you","can","use","x_mean_fn","and","z_mean_fn","to","alter","the","behavior","of","the","unscented","transform",".","Returns","--","--","--","-","means",":","ndarray","(","(","n",",","dim_x,1",")",")","array","of","the","state","for","each","time","step","after","the","update",".","Each","entry","is","an","np.array",".","In","other","words","`","means","[","k",",",":","]","`","is","the","state","at","step","`","k","`",".","covariance",":","ndarray","(","(","n",",","dim_x",",","dim_x",")",")","array","of","the","covariances","for","each","time","step","after","the","update",".","In","other","words","`","covariance","[","k",",",":",",",":","]","`","is","the","covariance","at","step","`","k","`","."]
code: def batch_filter(self, zs, Rs=None, UT=None):
      """Performs the UKF filter over the list of measurement in `zs`.
  
      Parameters
      ----------
  
      zs : list-like
          list of measurements at each time step `self._dt` Missing
          measurements must be represented by 'None'.
  
      Rs : list-like, optional
          optional list of values to use for the measurement error
          covariance; a value of None in any position will cause the filter
          to use `self.R` for that time step.
  
      UT : function(sigmas, Wm, Wc, noise_cov), optional
          Optional function to compute the unscented transform for the sigma
          points passed through hx. Typically the default function will
          work - you can use x_mean_fn and z_mean_fn to alter the behavior
          of the unscented transform.
  
      Returns
      -------
  
      means: ndarray((n,dim_x,1))
          array of the state for each time step after the update. Each entry
          is an np.array. In other words `means[k,:]` is the state at step
          `k`.
  
      covariance: ndarray((n,dim_x,dim_x))
          array of the covariances for each time step after the update.
          In other words `covariance[k,:,:]` is the covariance at step `k`.
      """
  
      try:
          z = zs[0]
      except:
          assert not isscalar(zs), "zs must be list-like"
  
      if self._dim_z == 1:
          assert isscalar(z) or (
              z.ndim == 1 and len(z) == 1
          ), "zs must be a list of scalars or 1D, 1 element arrays"
  
      else:
          assert len(z) == self._dim_z, (
              "each element in zs must be a"
              "1D array of length {}".format(self._dim_z)
          )
  
      z_n = np.size(zs, 0)
      if Rs is None:
          Rs = [None] * z_n
  
      # mean estimates from Kalman Filter
      means = zeros((z_n, self._dim_x, 1))
  
      # state covariances from Kalman Filter
      covariances = zeros((z_n, self._dim_x, self._dim_x))
  
      for i, (z, r) in enumerate(zip(zs, Rs)):
          self.predict(UT=UT)
          self.update(z, r, UT=UT)
          means[i, :] = self.x
          covariances[i, :, :] = self.P
  
      return (means, covariances)
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import matplotlib.pyplot
  import numpy.random
  from numpy.random import randn
  from numpy import asarray
  import numpy
  from filterpy.kalman import UnscentedKalmanFilter
  from filterpy.kalman import unscented_transform, MerweScaledSigmaPoints, JulierSigmaPoints, SimplexSigmaPoints
  from filterpy.common import Q_discrete_white_noise
  import filterpy.stats
  from math import cos, sin
  from filterpy.kalman import UnscentedKalmanFilter2
label_desc: Use image node_id 5 for calling the UnscentedKalmanFilter2 obj's underlying member method code with example usage: obj.batch_filter(zs, Rs, UT) and returns: means,  covariances