Module Expr Str ImportFrom alias alias alias alias Import alias identifier ImportFrom alias ImportFrom alias alias alias alias ImportFrom alias ImportFrom alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assert CompareGt NameLoad Num Assign AttributeStore NameLoad attr Call NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr BinOpMult ListLoad Num AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assert CompareEq AttributeLoad NameLoad attr Num Assign AttributeStore NameLoad attr Call NameLoad keyword NameLoad keyword NameLoad keyword AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str If CompareIs NameLoad NameLoad body Return If CompareIs NameLoad NameLoad body Assign NameStore AttributeLoad NameLoad attr If Call AttributeLoad NameLoad attr NameLoad body Assign NameStore BinOpMult Call NameLoad AttributeLoad NameLoad attr NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad TupleLoad NameLoad NameLoad For NameStore Call NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Num Assign NameStore Num For NameStore NameLoad body Assign NameStore BinOpSub NameLoad NameLoad AugAssignAdd NameStore Call NameLoad NameLoad NameLoad Assign NameStore BinOpAdd BinOpDiv NameLoad BinOpSub NameLoad Num NameLoad Assign NameStore Num For NameStore Call NameLoad NameLoad body AugAssignAdd NameStore Call NameLoad BinOpSub SubscriptLoad AttributeLoad NameLoad attr Index NameLoad AttributeLoad NameLoad attr BinOpSub SubscriptLoad NameLoad Index NameLoad NameLoad AugAssignDiv NameStore BinOpSub NameLoad Num Assign NameStore Call NameLoad NameLoad Call NameLoad NameLoad Assign NameStore Call NameLoad BinOpMult ListLoad Num NameLoad NameLoad NameLoad For NameStore Call NameLoad NameLoad body AugAssignAdd SubscriptStore AttributeLoad NameLoad attr Index NameLoad Call NameLoad NameLoad BinOpSub BinOpAdd NameLoad SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword Num Assign AttributeStore NameLoad attr BinOpSub AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr For TupleStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr body Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad AugAssignAdd AttributeStore NameLoad attr NameLoad Assign NameStore Num For NameStore AttributeLoad NameLoad attr body Assign NameStore BinOpSub NameLoad AttributeLoad NameLoad attr AugAssignAdd NameStore Call NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr BinOpDiv NameLoad BinOpSub NameLoad Num decorator_list decorator_list
N/A N/A Copyright 2015 Roger R Labbe Jr.

FilterPy library.
http://github.com/rlabbe/filterpy

Documentation at:
https://filterpy.readthedocs.org

Supporting book at:
https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python

This is licensed under an MIT license. See the readme.MD file
for more information.
 __future__ absolute_import division print_function unicode_literals N/A numpy np scipy.linalg inv numpy dot zeros eye outer numpy.random multivariate_normal filterpy.common dot3 EnsembleKalmanFilter N/A object N/A N/A  This implements the ensemble Kalman filter (EnKF). The EnKF uses
    an ensemble of hundreds to thousands of state vectors that are randomly
    sampled around the estimate, and adds perturbations at each update and
    predict step. It is useful for extremely large systems such as found
    in hydrophysics. As such, this class is admittedly a toy as it is far
    too slow with large N.

    There are many versions of this sort of this filter. This formulation is
    due to Crassidis and Junkins [1]. It works with both linear and nonlinear
    systems.

    References
    ----------

    - [1] John L Crassidis and John L. Junkins. "Optimal Estimation of
      Dynamic Systems. CRC Press, second edition. 2012. pp, 257-9.
     __init__ N/A N/A self x P dim_z dt N hx fx N/A N/A N/A  Create a Kalman filter. You are responsible for setting the
        various state variables to reasonable values; the defaults below will
        not give you a functional filter.

        Parameters
        ----------

        x : np.array(dim_z)
            state mean

        P : np.array((dim_x, dim_x))
            covariance of the state

        dim_z : int
            Number of of measurement inputs. For example, if the sensor
            provides you with position in (x,y), dim_z would be 2.

        dt : float
            time step in seconds

        N : int
            number of sigma points (ensembles). Must be greater than 1.

        hx : function hx(x)
            Measurement function. May be linear or nonlinear - converts state
            x into a measurement. Return must be an np.array of the same
            dimensionality as the measurement vector.

        fx : function fx(x, dt)
            State transition function. May be linear or nonlinear. Projects
            state x into the next time period. Returns the projected state x.

        Examples
        --------

        .. code-block:: Python

            def hx(x):
               return np.array([x[0]])

            F = np.array([[1., 1.],
                          [0., 1.]])
            def fx(x, dt):
                return np.dot(F, x)

            x = np.array([0., 1.])
            P = np.eye(2) * 100.
            dt = 0.1
            f = EnKF(x=x, P=P, dim_z=1, dt=dt, N=8,
                     hx=hx, fx=fx)

            std_noise = 3.
            f.R *= std_noise**2
            f.Q = Q_discrete_white_noise(2, dt, .01)

            while True:
                z = read_sensor()
                f.predict()
                f.update(np.asarray([z]))

         N/A N/A dim_z 0 N/A N/A self dim_x N/A len x N/A N/A self dim_z dim_z N/A N/A self dt dt N/A N/A self N N N/A N/A self hx hx N/A N/A self fx fx N/A N/A self Q N/A eye N/A self dim_x N/A N/A self R N/A eye N/A self dim_z N/A N/A self mean N/A N/A 0 N/A self dim_x N/A N/A N/A self initialize x P N/A initialize N/A N/A self x P N/A N/A N/A  Initializes the filter with the specified mean and
        covariance. Only need to call this if you are using the filter
        to filter more than one set of data; this is called by __init__

        Parameters
        ----------

        x : np.array(dim_z)
            state mean

        P : np.array((dim_x, dim_x))
            covariance of the state
         N/A N/A N/A x ndim 1 N/A N/A self sigmas N/A multivariate_normal mean x cov P size N/A self N N/A N/A self x x N/A N/A self P P N/A update N/A N/A self z R N/A None N/A N/A 
        Add a new measurement (z) to the kalman filter. If z is None, nothing
        is changed.

        Parameters
        ----------

        z : np.array
            measurement for this update.

        R : np.array, scalar, or None
            Optionally provide R to override the measurement noise for this
            one call, otherwise  self.R will be used.
         N/A N/A z None N/A N/A N/A N/A R None N/A N/A R N/A self R N/A N/A N/A np isscalar R N/A N/A R N/A N/A eye N/A self dim_z R N/A N N/A self N N/A dim_z N/A len z N/A sigmas_h N/A zeros N/A N dim_z N/A i N/A range N N/A N/A N/A sigmas_h N/A i N/A N/A self hx N/A N/A self sigmas N/A i N/A z_mean N/A N/A np mean sigmas_h axis 0 N/A P_zz 0 N/A sigma sigmas_h N/A N/A s N/A sigma z_mean N/A P_zz N/A outer s s N/A P_zz N/A N/A P_zz N/A N 1 R N/A P_xz 0 N/A i N/A range N N/A N/A P_xz N/A outer N/A N/A N/A self sigmas N/A i N/A self x N/A N/A sigmas_h N/A i z_mean N/A P_xz N/A N 1 N/A K N/A dot P_xz N/A inv P_zz N/A e_r N/A multivariate_normal N/A N/A 0 dim_z R N N/A i N/A range N N/A N/A N/A N/A self sigmas N/A i N/A dot K N/A N/A z N/A e_r N/A i N/A sigmas_h N/A i N/A N/A self x N/A N/A np mean N/A self sigmas axis 0 N/A N/A self P N/A N/A self P N/A dot3 K P_zz N/A K T N/A predict N/A N/A self N/A N/A N/A  Predict next position.  N/A N N/A self N N/A N/A i s N/A enumerate N/A self sigmas N/A N/A N/A N/A self sigmas N/A i N/A N/A self fx s N/A self dt N/A e N/A multivariate_normal N/A self mean N/A self Q N N/A N/A self sigmas e N/A P 0 N/A s N/A self sigmas N/A N/A sx N/A s N/A self x N/A P N/A outer sx sx N/A N/A self P N/A P N/A N 1 N/A N/A