code: def test_big_data():
      N = 1000000
  
      xs = np.array([i + random.randn() for i in range(N)])
      for order in [1, 2]:
          lsq = LeastSquaresFilter(dt=1, order=order)
          ys = np.array([lsq.update(x)[0] for x in xs])
  
          delta = xs - ys
          assert delta.max() < 6, delta.max()
          assert delta.min() > -6, delta.min()
  
      # zero order is special case, it can't adapt quickly to changing data
      xs = np.array([random.randn() for i in range(N)])
      lsq = LeastSquaresFilter(dt=1, order=0)
      ys = np.array([lsq.update(x)[0] for x in xs])
  
      delta = xs - ys
      assert delta.max() < 6, delta.max()
      assert delta.min() > -6, delta.min()
  
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 8 for calling a global function with example usage: test_big_data() without return types