-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generator functions, control input, DK smoothing #52
Conversation
…n) and fix deprecation warnings
…aned up dependencies
(for later extension)
Ok, all done. If we decide to make this 0.1.0, I'll update NEWS before merging. |
Some basic benchmarking for each commit: using TimeModels
m, b, s, dt = 5, 2, 2, .1
t = 0:dt:10000
y_true = m*t + b
y_noisy = y_true + s*randn(length(t))
blm = StateSpaceModel([[1 dt; 0 1] zeros(2,28); zeros(28,30)], 1e-6*eye(30), [1. zeros(29)'], s*eye(1), zeros(30), diagm([100; 100; zeros(28)]))
kalman_smooth(y_noisy, blm)
@time kalman_smooth(y_noisy, blm) Baseline: |
|
||
# Process transition matrix, control matrix, and noise covariance | ||
F::Function | ||
B::Matrix{T} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could the control and feed-forward matrices be functions too? I have not seen this done, but I could imagine situations where it could be useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure - I need to put in a bit more thought about how EM estimation of time-independent parameters will best integrate with time-dependent system matrices, but the Kalman filtering / smoothing part should be simple.
@GordStephen no objections here to your managing the transition to 0.1.0 |
I went all-in and allowed the noise covariance matrices to be time-dependent in addition to the exogenous input matrices. Performance check: |
Extend time-dependent system matrices, add control input, implement DK smoothing
I realized yesterday that my local development has gotten way ahead of master - not a good thing! I'll try to catch this up gradually, starting with small changes. I'll push a few more commits to this PR before requesting it be considered for merging and tagging as 0.1.0 (dropping Julia 0.3 support), namely:
Once that's done and everyone's happy with it, I'll start a new PR with the next wave of updates - constrained parameter fitting and EM estimation (I don't currently have time-dependent system matrices supported, but I'll get that done). After that I'll start a third PR with alternative implementations of smoothing and parameter estimation using sparse matrices (slower for small systems, but much more efficient for large ones with deterministic state transitions, like seasonal ARMA models).