Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/rlabbe/filterpy
Browse files Browse the repository at this point in the history
  • Loading branch information
rlabbe committed Jun 19, 2016
2 parents abb540c + f258a36 commit 72c2482
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 26 deletions.
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
he MIT License (MIT)
The MIT License (MIT)

Copyright (c) 2015 Roger R. Labbe Jr

Expand All @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
THE SOFTWARE.
Empty file added __init__.py
Empty file.
14 changes: 8 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
import os

import mock

MOCK_MODULES = ['numpy', 'scipy', 'matplotlib', 'matplotlib.pyplot',
'scipy.linalg', 'numpy.linalg', 'matplotlib.pyplot',
'numpy.random', 'scipy.sparse', 'scipy.sparse.linalg',
'scipy.stats', 'matplotlib.patches', 'scipy.ndimage.filters',
'scipy.ndimage.interpolation']
'scipy.ndimage.interpolation', 'scipy.ndimage']

for mod_name in MOCK_MODULES:
sys.modules[mod_name] = mock.Mock()

Expand All @@ -32,7 +32,8 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('../filterpy'))
#sys.path.insert(0, os.path.abspath('../filterpy'))
sys.path.insert(0, os.path.abspath('../'))

from filterpy import *
import filterpy
Expand All @@ -53,7 +54,8 @@
'sphinx.ext.intersphinx',
'sphinx.ext.mathjax',
'sphinx.ext.viewcode',
'sphinx.ext.autodoc'
'sphinx.ext.autodoc',
'numpydoc'
]

# Add any paths that contain templates here, relative to this directory.
Expand Down Expand Up @@ -357,4 +359,4 @@
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'http://docs.python.org/': None}

autodoc_member_order = 'bysource'
autodoc_member_order = 'bysource'
2 changes: 0 additions & 2 deletions docs/discrete_bayes/discrete_bayes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,3 @@ words go here
-----

.. autofunction:: predict

-----
2 changes: 1 addition & 1 deletion filterpy/kalman/EKF.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def predict_update(self, z, HJacobian, Hx, args=(), hx_args=(), u=0):
variable.
hx_args : tuple, optional, default (,)
arguments to be passed into HJacobian after the required state
arguments to be passed into Hx after the required state
variable.
u : np.array or scalar
Expand Down
32 changes: 17 additions & 15 deletions filterpy/kalman/kalman_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,21 +468,21 @@ def batch_filter(self, zs, Fs=None, Qs=None, Hs=None, Rs=None, Bs=None, us=None,
Returns
-------
means: np.array((n,dim_x,1))
means : np.array((n,dim_x,1))
array of the state for each time step after the update. Each entry
is an np.array. In other words `means[k,:]` is the state at step
`k`.
covariance: np.array((n,dim_x,dim_x))
covariance : np.array((n,dim_x,dim_x))
array of the covariances for each time step after the update.
In other words `covariance[k,:,:]` is the covariance at step `k`.
means_predictions: np.array((n,dim_x,1))
means_predictions : np.array((n,dim_x,1))
array of the state for each time step after the predictions. Each
entry is an np.array. In other words `means[k,:]` is the state at
step `k`.
covariance_predictions: np.array((n,dim_x,dim_x))
covariance_predictions : np.array((n,dim_x,dim_x))
array of the covariances for each time step after the prediction.
In other words `covariance[k,:,:]` is the covariance at step `k`.
Expand Down Expand Up @@ -645,7 +645,7 @@ def get_prediction(self, u=0):
Returns
-------
(x, P)
(x, P) : tuple
State vector and covariance array of the prediction.
"""

Expand Down Expand Up @@ -1006,34 +1006,36 @@ def batch_filter(x, P, zs, Fs, Qs, Hs, Rs, Bs=None, us=None, update_first=False)
Returns
-------
means: np.array((n,dim_x,1))
means : np.array((n,dim_x,1))
array of the state for each time step after the update. Each entry
is an np.array. In other words `means[k,:]` is the state at step
`k`.
covariance: np.array((n,dim_x,dim_x))
covariance : np.array((n,dim_x,dim_x))
array of the covariances for each time step after the update.
In other words `covariance[k,:,:]` is the covariance at step `k`.
means_predictions: np.array((n,dim_x,1))
means_predictions : np.array((n,dim_x,1))
array of the state for each time step after the predictions. Each
entry is an np.array. In other words `means[k,:]` is the state at
step `k`.
covariance_predictions: np.array((n,dim_x,dim_x))
covariance_predictions : np.array((n,dim_x,dim_x))
array of the covariances for each time step after the prediction.
In other words `covariance[k,:,:]` is the covariance at step `k`.
Examples
--------
zs = [t + random.randn()*4 for t in range (40)]
Fs = [kf.F for t in range (40)]
Hs = [kf.H for t in range (40)]
.. code-block:: Python
zs = [t + random.randn()*4 for t in range (40)]
Fs = [kf.F for t in range (40)]
Hs = [kf.H for t in range (40)]
(mu, cov, _, _) = kf.batch_filter(zs, Rs=R_list, Fs=Fs, Hs=Hs, Qs=None,
Bs=None, us=None, update_first=False)
(xs, Ps, Ks) = kf.rts_smoother(mu, cov, Fs=Fs, Qs=None)
(mu, cov, _, _) = kf.batch_filter(zs, Rs=R_list, Fs=Fs, Hs=Hs, Qs=None,
Bs=None, us=None, update_first=False)
(xs, Ps, Ks) = kf.rts_smoother(mu, cov, Fs=Fs, Qs=None)
"""

Expand Down

0 comments on commit 72c2482

Please sign in to comment.