Skip to content

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

Merged
merged 43 commits into from
Aug 16, 2021
Merged

Diagonal EK1 #30

merged 43 commits into from
Aug 16, 2021

Conversation

pnkraemer
Copy link
Owner

@pnkraemer pnkraemer commented Aug 14, 2021

This PR establishes a version of the EK1 with diagonal Jacobians (which always -- successfully -- pushes around block-diagonal matrices).

Adaptive steps? Yes.
Calibration? dynamic.

Comment on lines +127 to +130
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)
Copy link
Owner Author

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.

Copy link
Owner Author

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 :)

@pnkraemer pnkraemer linked an issue Aug 15, 2021 that may be closed by this pull request
@pnkraemer pnkraemer mentioned this pull request Aug 15, 2021
Comment on lines +179 to +180
# 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)
Copy link
Owner Author

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
Comment on lines 216 to 220
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 == ()
Copy link
Owner Author

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
Copy link
Owner Author

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
Copy link
Owner Author

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 :)

@pnkraemer
Copy link
Owner Author

I will merge now. there are three PRs open, and one of us has to start :)

@pnkraemer pnkraemer merged commit 7fdc139 into main Aug 16, 2021
@nathanaelbosch nathanaelbosch deleted the nk/diagonal-ek1 branch September 2, 2021 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EK1 "Diagonal"
2 participants