code: def predict(x, P, F=1, Q=0, u=0, B=1, alpha=1.):
      
  
      if np.isscalar(F):
          F = np.array(F)
      x = dot(F, x) + dot(B, u)
      P = (alpha * alpha) * dot(dot(F, P), F.T) + Q
  
      return x, P
docs: Predict next state (prior) using the Kalman filter state propagation
      equations.
  
      Parameters
      ----------
  
      x : numpy.array
          State estimate vector
  
      P : numpy.array
          Covariance matrix
  
      F : numpy.array()
          State Transition matrix
  
      Q : numpy.array, Optional
          Process noise matrix
  
  
      u : numpy.array, Optional, default 0.
          Control vector. If non-zero, it is multiplied by B
          to create the control input into the system.
  
      B : numpy.array, optional, default 0.
          Control transition matrix.
  
      alpha : float, Optional, default=1.0
          Fading memory setting. 1.0 gives the normal Kalman filter, and
          values slightly larger than 1.0 (such as 1.02) give a fading
          memory effect - previous measurements have less influence on the
          filter's estimates. This formulation of the Fading memory filter
          (there are many) is due to Dan Simon
  
      Returns
      -------
  
      x : numpy.array
          Prior state estimate vector
  
      P : numpy.array
          Prior covariance matrix