-
Notifications
You must be signed in to change notification settings - Fork 1
Diagonal EK1 #30
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
Diagonal EK1 #30
Conversation
assert isinstance(P, linops.BlockDiagonal) | ||
assert isinstance(Pinv, linops.BlockDiagonal) | ||
assert P.array_stack.shape == (d, n, n) | ||
assert Pinv.array_stack.shape == (d, n, n) |
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.
there are a million asserts everywhere. I would propose to leave them while the thing is not complete (it made it much easier to detect issues while developing). I can remove them, though, if you prefer me to.
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.
it might also be nice as a little bit of documentation for the current, early phase :)
# Due to the block-diagonal structure in H (and in C), S is diagonal! | ||
# We can compute the correction really cheaply (like in the EK0, actually) |
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.
might have been clear to you guys, to me it wasnt and I am really surprised by this!
tornado/ek1.py
Outdated
innov_stds = innov_chol.array_stack[:, 0, 0] # (was shape (d,1,1)) | ||
s = z / innov_stds | ||
sigma_squared_increment = s.T @ s / d | ||
assert isinstance(sigma_squared_increment, jnp.ndarray) | ||
assert sigma_squared_increment.shape == () |
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.
to do the calibration-for-error-estimation, I use the "increment" from the global sigma quasi-MLE. Am I bastardising this too much? It seems that for now, it works okay. Stiff van-der-pol is a different PR though anyway ;) (... I actually tried! :D More on this later...)
@@ -11,8 +11,8 @@ class MultivariateNormal: | |||
"""Multivariate normal distributions.""" | |||
|
|||
mean: jax.numpy.ndarray | |||
cov_cholesky: jax.numpy.ndarray | |||
cov_sqrtm: jax.numpy.ndarray |
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.
see #31. If you dont like this, we can discuss there? Or comment here, I am fine with both...
@@ -6,10 +6,10 @@ isolated_build = True | |||
description = Executing tests with pytest | |||
deps = | |||
pytest | |||
pytest-randomly |
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.
shuffles the tests each time they are executed. I used this to assert that there was no weird in-place/variable-lifetime behaviour, and kind of liked it :)
I will merge now. there are three PRs open, and one of us has to start :) |
This PR establishes a version of the EK1 with diagonal Jacobians (which always -- successfully -- pushes around block-diagonal matrices).
Adaptive steps? Yes.
Calibration? dynamic.