0

All the examples I've seen on pykalman documentation works on a given dataset, I was wandering how it could be used by feeding a single observation at the time while taking into account the time delta.

From the documentation:

from pykalman import KalmanFilter
import numpy as np
kf = KalmanFilter(transition_matrices = [[1, 1], [0, 1]], observation_matrices = [[0.1, 0.5], [-0.3, 0.0]])
measurements = np.asarray([[1,0], [0,0], [0,1]])  # 3 observations
kf = kf.em(measurements, n_iter=5)
(filtered_state_means, filtered_state_covariances) = kf.filter(measurements)
(smoothed_state_means, smoothed_state_covariances) = kf.smooth(measurements)
Cesar
  • 4,418
  • 2
  • 31
  • 37
  • 2
    I'm not familiar with the library (and only vaguely with Kalman filtering), but [`filter_update`](http://pykalman.github.io/#pykalman.KalmanFilter.filter_update) seems to be along the lines of what you need... – jdehesa Mar 23 '18 at 17:15
  • I posted my code with pykalman and working data here https://stackoverflow.com/questions/47599886/kalman-filter-with-varying-timesteps. I think it can help you. The data can be downloaded from here https://drive.google.com/open?id=1YIAr8FG_t2RZvQvd17KlQrDvTwtz9vDv – Anton Mar 27 '18 at 15:09
  • In answering another question on pykalman library I showed how a filter trained on a historic data set can then be used online. Perhaps it is useful for you: https://stackoverflow.com/questions/43377626/how-to-use-kalman-filter-in-python-for-location-data/43568887#43568887 – kabdulla Nov 10 '18 at 14:55

0 Answers0