class_docstr: Implements a Least Squares recursive filter. Formulation is per
  Zarchan [1].
  
  Filter may be of order 0 to 2. Order 0 assumes the value being tracked is
  a constant, order 1 assumes that it moves in a line, and order 2 assumes
  that it is tracking a second order polynomial.
  
  It is implemented to be directly callable like a function. See examples.
  
  Examples
  --------
  
  lsq = LeastSquaresFilter(dt=0.1, order=1, noise_variance=2.3)
  
  while True:
      z = sensor_reading()  # get a measurement
      x = lsq(z)            # get the filtered estimate.
      print('error: {}, velocity error: {}'.format(lsq.error, lsq.derror))
  
  
  Attributes
  ----------
  
  n : int
      step in the recursion. 0 prior to first call, 1 after the first call,
      etc.
  
  K1,K2,K3 : float
      Gains for the filter. K1 for all orders, K2 for orders 0 and 1, and
      K3 for order 2
  
  x, dx, ddx: type(z)
      estimate(s) of the output. 'd' denotes derivative, so 'dx' is the first
      derivative of x, 'ddx' is the second derivative.
  
  
  References
  ----------
  [1] Zarchan and Musoff. "Fundamentals of Kalman Filtering: A Practical
      Approach." Third Edition. AIAA, 2009.
class_docstr_tok: ["Implements","a","Least","Squares","recursive","filter",".","Formulation","is","per","Zarchan","[","1","]",".","Filter","may","be","of","order","0","to","2",".","Order","0","assumes","the","value","being","tracked","is","a","constant",",","order","1","assumes","that","it","moves","in","a","line",",","and","order","2","assumes","that","it","is","tracking","a","second","order","polynomial",".","It","is","implemented","to","be","directly","callable","like","a","function",".","See","examples",".","Examples","--","--","--","--","lsq","=","LeastSquaresFilter","(","dt=0.1",",","order=1",",","noise_variance=2.3",")","while","True",":","z","=","sensor_reading","(",")","#","get","a","measurement","x","=","lsq","(","z",")","#","get","the","filtered","estimate",".","print","(","'error",":","{","}",",","velocity","error",":","{","}","'.format","(","lsq.error",",","lsq.derror",")",")","Attributes","--","--","--","--","--","n",":","int","step","in","the","recursion",".","0","prior","to","first","call",",","1","after","the","first","call",",","etc",".","K1",",","K2",",","K3",":","float","Gains","for","the","filter",".","K1","for","all","orders",",","K2","for","orders","0","and","1",",","and","K3","for","order","2","x",",","dx",",","ddx",":","type","(","z",")","estimate","(","s",")","of","the","output",".","'d","'","denotes","derivative",",","so","'dx","'","is","the","first","derivative","of","x",",","'ddx","'","is","the","second","derivative",".","References","--","--","--","--","--","[","1","]","Zarchan","and","Musoff",".","``","Fundamentals","of","Kalman","Filtering",":","A","Practical","Approach",".","''","Third","Edition",".","AIAA",",","2009","."]
code: def __repr__(self):
      return "LeastSquareFilter x={}, dx={}, ddx={}".format(
          self.x, self.dx, self.ddx
      )
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  from math import sqrt
  import matplotlib.pyplot
  import numpy
  from numpy import dot
  import numpy.random
  from scipy.linalg import inv
  from filterpy.gh import GHFilter
  from filterpy.leastsq import LeastSquaresFilter
label_desc: Use image node_id 5 for calling the LeastSquaresFilterOriginal obj's underlying member method code with example usage: obj.__repr__() and returns: str