code: def single_measurement_test():
      dt = 0.1
      sigma = 2.0
  
      kf2 = KalmanFilter(dim_x=2, dim_z=1)
  
      kf2.F = array([[1.0, dt], [0.0, 1.0]])
      kf2.H = array([[1.0, 0.0]])
      kf2.x = array([[0.0], [1.0]])
      kf2.Q = (
          array([[dt**3 / 3, dt**2 / 2], [dt**2 / 2, dt]]) * 0.02
      )
      kf2.P *= 100
      kf2.R[0, 0] = sigma**2
  
      random.seed(SEED)
      xs = []
      zs = []
      nom = []
      for i in range(1, 100):
          m0 = i + randn() * sigma
          z = array([[m0]])
  
          kf2.predict()
          kf2.update(z)
  
          xs.append(kf2.x.T[0])
          zs.append(z.T[0])
          nom.append(i)
  
      xs = asarray(xs)
      zs = asarray(zs)
      nom = asarray(nom)
  
      res = nom - xs[:, 0]
      std_dev = np.std(res)
      print("std: {:.3f}".format(std_dev))
  
      global DO_PLOT
      if DO_PLOT:
          plt.subplot(211)
          plt.plot(xs[:, 0])
          # plt.plot(zs[:,0])
  
          plt.subplot(212)
          plt.plot(res)
          plt.show()
  
      return std_dev
  
file_path: filterpy/filterpy/kalman/tests/test_sensor_fusion.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import numpy.random
  from numpy.random import randn
  import numpy
  import matplotlib.pyplot
  from filterpy.kalman import KalmanFilter
  from numpy import array, asarray
label_desc: Use image node_id 1 for calling a global function with example usage: single_measurement_test() and returns: std_dev