class_docstr: H-Infinity filter. You are responsible for setting the
  various state variables to reasonable values; the defaults below will
  not give you a functional filter.
  
  Parameters
  ----------
  
  dim_x : int
      Number of state variables for the Kalman filter. For example, if
      you are tracking the position and velocity of an object in two
      dimensions, dim_x would be 4.
  
      This is used to set the default size of `P`, `Q`, and `u`
  
  dim_z : int
      Number of of measurement inputs. For example, if the sensor
      provides you with position in (x, y), `dim_z` would be 2.
  
  dim_u : int
      Number of control inputs for the Gu part of the prediction step.
  
  gamma : float
  
  .. warning::
      I do not believe this code is correct. DO NOT USE THIS.
      In particular, note that predict does not update the covariance
      matrix.
class_docstr_tok: ["H-Infinity","filter",".","You","are","responsible","for","setting","the","various","state","variables","to","reasonable","values",";","the","defaults","below","will","not","give","you","a","functional","filter",".","Parameters","--","--","--","--","--","dim_x",":","int","Number","of","state","variables","for","the","Kalman","filter",".","For","example",",","if","you","are","tracking","the","position","and","velocity","of","an","object","in","two","dimensions",",","dim_x","would","be","4",".","This","is","used","to","set","the","default","size","of","`","P","`",",","`","Q","`",",","and","`","u","`","dim_z",":","int","Number","of","of","measurement","inputs",".","For","example",",","if","the","sensor","provides","you","with","position","in","(","x",",","y",")",",","`","dim_z","`","would","be","2.","dim_u",":","int","Number","of","control","inputs","for","the","Gu","part","of","the","prediction","step",".","gamma",":","float","..","warning",":",":","I","do","not","believe","this","code","is","correct",".","DO","NOT","USE","THIS",".","In","particular",",","note","that","predict","does","not","update","the","covariance","matrix","."]
docstr: Add a new measurement `z` to the H-Infinity filter. If `z` is None,
  nothing is changed.
  
  Parameters
  ----------
  z : ndarray
      measurement for this update.
docstr_tok: ["Add","a","new","measurement","`","z","`","to","the","H-Infinity","filter",".","If","`","z","`","is","None",",","nothing","is","changed",".","Parameters","--","--","--","--","--","z",":","ndarray","measurement","for","this","update","."]
code: def update(self, z):
      """
      Add a new measurement `z` to the H-Infinity filter. If `z` is None,
      nothing is changed.
  
      Parameters
      ----------
      z : ndarray
          measurement for this update.
      """
  
      if z is None:
          return
  
      # rename for readability and a tiny extra bit of speed
      I = self._I
      gamma = self.gamma
      Q = self.Q
      H = self.H
      P = self.P
      x = self.x
      V_inv = self._V_inv
      F = self.F
      W = self.W
  
      # common subexpression H.T * V^-1
      HTVI = dot(H.T, V_inv)
  
      L = linalg.inv(I - gamma * dot(Q, P) + dot(HTVI, H).dot(P))
  
      # common subexpression P*L
      PL = dot(P, L)
  
      K = dot(F, PL).dot(HTVI)
  
      self.y = z - dot(H, x)
  
      # x = x + Ky
      # predict new x with residual scaled by the H-Infinity gain
      self.x = self.x + dot(K, self.y)
      self.P = dot(F, PL).dot(F.T) + W
  
      # force P to be symmetric
      self.P = (self.P + self.P.T) / 2
  
      # pylint: disable=bare-except
      try:
          self.z = np.copy(z)
      except:
          self.z = copy.deepcopy(z)
  
file_path: filterpy/filterpy/hinfinity/hinfinity_filter.py
imports: from __future__ import absolute_import, division
  import copy
  import warnings
  import numpy
  from numpy import dot, zeros, eye
  import scipy.linalg
  from filterpy.common import pretty_str
label_desc: Use image node_id 2 for calling the HInfinityFilter obj's underlying member method code with example usage: obj.update(z) without return types