class_docstr: Implements an extended Kalman filter (EKF). You are responsible for
  setting the various state variables to reasonable values; the defaults
  will  not give you a functional filter.
  
  You will have to set the following attributes after constructing this
  object for the filter to perform properly. Please note that there are
  various checks in place to ensure that you have made everything the
  'correct' size. However, it is possible to provide incorrectly sized
  arrays such that the linear algebra can not perform an operation.
  It can also fail silently - you can end up with matrices of a size that
  allows the linear algebra to work, but are the wrong shape for the problem
  you are trying to solve.
  
  Parameters
  ----------
  
  dim_x : int
      Number of state variables for the Kalman filter. For example, if
      you are tracking the position and velocity of an object in two
      dimensions, dim_x would be 4.
  
      This is used to set the default size of P, Q, and u
  
  dim_z : int
      Number of measurement inputs. For example, if the sensor
      provides you with position in (x,y), dim_z would be 2.
  
  Attributes
  ----------
  x : numpy.array(dim_x, 1)
      State estimate vector
  
  P : numpy.array(dim_x, dim_x)
      Covariance matrix
  
  x_prior : numpy.array(dim_x, 1)
      Prior (predicted) state estimate. The *_prior and *_post attributes
      are for convienence; they store the  prior and posterior of the
      current epoch. Read Only.
  
  P_prior : numpy.array(dim_x, dim_x)
      Prior (predicted) state covariance matrix. Read Only.
  
  x_post : numpy.array(dim_x, 1)
      Posterior (updated) state estimate. Read Only.
  
  P_post : numpy.array(dim_x, dim_x)
      Posterior (updated) state covariance matrix. Read Only.
  
  R : numpy.array(dim_z, dim_z)
      Measurement noise matrix
  
  Q : numpy.array(dim_x, dim_x)
      Process noise matrix
  
  F : numpy.array()
      State Transition matrix
  
  H : numpy.array(dim_x, dim_x)
      Measurement function
  
  y : numpy.array
      Residual of the update step. Read only.
  
  K : numpy.array(dim_x, dim_z)
      Kalman gain of the update step. Read only.
  
  S :  numpy.array
      Systen uncertaintly projected to measurement space. Read only.
  
  z : ndarray
      Last measurement used in update(). Read only.
  
  log_likelihood : float
      log-likelihood of the last measurement. Read only.
  
  likelihood : float
      likelihood of last measurment. Read only.
  
      Computed from the log-likelihood. The log-likelihood can be very
      small,  meaning a large negative value such as -28000. Taking the
      exp() of that results in 0.0, which can break typical algorithms
      which multiply by this value, so by default we always return a
      number >= sys.float_info.min.
  
  mahalanobis : float
      mahalanobis distance of the innovation. E.g. 3 means measurement
      was 3 standard deviations away from the predicted value.
  
      Read only.
  
  Examples
  --------
  
  See my book Kalman and Bayesian Filters in Python
  https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python
class_docstr_tok: ["Implements","an","extended","Kalman","filter","(","EKF",")",".","You","are","responsible","for","setting","the","various","state","variables","to","reasonable","values",";","the","defaults","will","not","give","you","a","functional","filter",".","You","will","have","to","set","the","following","attributes","after","constructing","this","object","for","the","filter","to","perform","properly",".","Please","note","that","there","are","various","checks","in","place","to","ensure","that","you","have","made","everything","the","'correct","'","size",".","However",",","it","is","possible","to","provide","incorrectly","sized","arrays","such","that","the","linear","algebra","can","not","perform","an","operation",".","It","can","also","fail","silently","-","you","can","end","up","with","matrices","of","a","size","that","allows","the","linear","algebra","to","work",",","but","are","the","wrong","shape","for","the","problem","you","are","trying","to","solve",".","Parameters","--","--","--","--","--","dim_x",":","int","Number","of","state","variables","for","the","Kalman","filter",".","For","example",",","if","you","are","tracking","the","position","and","velocity","of","an","object","in","two","dimensions",",","dim_x","would","be","4",".","This","is","used","to","set","the","default","size","of","P",",","Q",",","and","u","dim_z",":","int","Number","of","measurement","inputs",".","For","example",",","if","the","sensor","provides","you","with","position","in","(","x",",","y",")",",","dim_z","would","be","2",".","Attributes","--","--","--","--","--","x",":","numpy.array","(","dim_x",",","1",")","State","estimate","vector","P",":","numpy.array","(","dim_x",",","dim_x",")","Covariance","matrix","x_prior",":","numpy.array","(","dim_x",",","1",")","Prior","(","predicted",")","state","estimate",".","The","*","_prior","and","*","_post","attributes","are","for","convienence",";","they","store","the","prior","and","posterior","of","the","current","epoch",".","Read","Only",".","P_prior",":","numpy.array","(","dim_x",",","dim_x",")","Prior","(","predicted",")","state","covariance","matrix",".","Read","Only",".","x_post",":","numpy.array","(","dim_x",",","1",")","Posterior","(","updated",")","state","estimate",".","Read","Only",".","P_post",":","numpy.array","(","dim_x",",","dim_x",")","Posterior","(","updated",")","state","covariance","matrix",".","Read","Only",".","R",":","numpy.array","(","dim_z",",","dim_z",")","Measurement","noise","matrix","Q",":","numpy.array","(","dim_x",",","dim_x",")","Process","noise","matrix","F",":","numpy.array","(",")","State","Transition","matrix","H",":","numpy.array","(","dim_x",",","dim_x",")","Measurement","function","y",":","numpy.array","Residual","of","the","update","step",".","Read","only",".","K",":","numpy.array","(","dim_x",",","dim_z",")","Kalman","gain","of","the","update","step",".","Read","only",".","S",":","numpy.array","Systen","uncertaintly","projected","to","measurement","space",".","Read","only",".","z",":","ndarray","Last","measurement","used","in","update","(",")",".","Read","only",".","log_likelihood",":","float","log-likelihood","of","the","last","measurement",".","Read","only",".","likelihood",":","float","likelihood","of","last","measurment",".","Read","only",".","Computed","from","the","log-likelihood",".","The","log-likelihood","can","be","very","small",",","meaning","a","large","negative","value","such","as","-28000",".","Taking","the","exp","(",")","of","that","results","in","0.0",",","which","can","break","typical","algorithms","which","multiply","by","this","value",",","so","by","default","we","always","return","a","number",">","=","sys.float_info.min",".","mahalanobis",":","float","mahalanobis","distance","of","the","innovation",".","E.g",".","3","means","measurement","was","3","standard","deviations","away","from","the","predicted","value",".","Read","only",".","Examples","--","--","--","--","See","my","book","Kalman","and","Bayesian","Filters","in","Python","https",":","\/\/github.com\/rlabbe\/Kalman-and-Bayesian-Filters-in-Python"]
docstr: Predicts the next state of X. If you need to
  compute the next state yourself, override this function. You would
  need to do this, for example, if the usual Taylor expansion to
  generate F is not providing accurate results for you.
docstr_tok: ["Predicts","the","next","state","of","X",".","If","you","need","to","compute","the","next","state","yourself",",","override","this","function",".","You","would","need","to","do","this",",","for","example",",","if","the","usual","Taylor","expansion","to","generate","F","is","not","providing","accurate","results","for","you","."]
code: def predict_x(self, u=0):
      """
      Predicts the next state of X. If you need to
      compute the next state yourself, override this function. You would
      need to do this, for example, if the usual Taylor expansion to
      generate F is not providing accurate results for you.
      """
      self.x = dot(self.F, self.x) + dot(self.B, u)
  
file_path: filterpy/filterpy/kalman/EKF.py
imports: from __future__ import absolute_import, division, unicode_literals
  from copy import deepcopy
  from math import log, exp, sqrt
  import sys
  import numpy
  from numpy import dot, zeros, eye
  import scipy.linalg
  from filterpy.stats import logpdf
  from filterpy.common import pretty_str, reshape_z
label_desc: Use image node_id 4 for calling the ExtendedKalmanFilter obj's underlying member method code with example usage: obj.predict_x(u) without return types