code: def test_linear_1d():
      """should work like a linear KF if problem is linear"""
  
      def fx(x, dt):
          F = np.array([[1.0, dt], [0, 1]], dtype=float)
  
          return np.dot(F, x)
  
      def hx(x):
          return np.array([x[0]])
  
      dt = 0.1
      points = MerweScaledSigmaPoints(2, 0.1, 2.0, -1)
      kf = UKF(dim_x=2, dim_z=1, dt=dt, fx=fx, hx=hx, points=points)
  
      kf.x = np.array([1, 2])
      kf.P = np.array([[1, 1.1], [1.1, 3]])
      kf.R *= 0.05
      kf.Q = np.array([[0.0, 0], [0.0, 0.001]])
  
      z = np.array([2.0])
      kf.predict()
      kf.update(z)
  
      zs = []
      for i in range(50):
          z = np.array([i + randn() * 0.1])
          zs.append(z)
  
          kf.predict()
          kf.update(z)
          print("K", kf.K.T)
          print("x", kf.x)
  
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 12 for calling a global function with example usage: test_linear_1d() and returns: np, np