Search code examples
pythonforecastingkalman-filter

what does "observation offset" and "predicted state mean" mean in pykalman standard filtercorrect module?


I am using a module pykalman in which I imported a function named _filter_correct in pyklaman.standard in order to correct my forecast data.

There are parameters in the function I do not understand even after trying to understand what is behind the function.

They say that:

  • observation_offset is offset for observation at time t
  • predict_state_mean which is the mean of state at time t given observations from times[0...t-1].
  • I understood the other parameters

I am forecasting by the way a univariate parameter(wind speed) for 7 days 6 hours ahead that I am concatenating!

Can you help me on the parameters of this function ?


Solution

  • As far as I understand observation_offset is really the measured noise mean. Kalman requires the noise to be zero mean Gaussian signal where an offset will break the prediction, library eliminated the offset by himself so asks for you to give value before. (But I don't think that necessary because I guess it calculates it anyway. Giving it before will just help for first iterations. But not sure because documentation is very poor. Another clue for hypothesis is that he assigned NULL as default value, so NULL should not be a problem)

    For example, if your thermometer always gives the result as real_temperature + 2 + zero_mean_gaussion_noise then your observation_offset must be 2 to draw back noise to zero mean. Here you can find more detailed information.

    I again assume (because couldn't find any predicted_state_mean so far through googling)predicted_state_mean as the name suggest the predicted result value. Kalman Filter has two phases; prediction and update. In prediction depending on your system dynamics, with the knowledge of your current state, you are predicting the next state.

    Such as if you have a car at point 0 and moving with 5 units/seconds, then after 2 seconds your car will be at point 10. Kalman first predicts this information then compares the predicted and observed (your sensor data) results in the update state.