Advanced Sequential Filters¶
Specialised deterministic variants of the everyday
Layer-1 filters (ETKF, EnSRF, StochasticEnKF, LETKF).
Use those as the defaults; reach for these when you need the specific
properties below. All three implement
AbstractSequentialFilter, so they
slot into the same Layer-2 loops and pipekit adapters.
Picking an advanced filter¶
| Filter | Family | When to use |
|---|---|---|
filterax.filters.ETKF_Livings |
Deterministic, randomised | When the symmetric-sqrt ETKF develops preferred ensemble directions over long runs — the random mean-preserving rotation averages out the degeneracy. |
filterax.filters.EnSRF_Serial |
Deterministic, scalar-serial | When R is diagonal and you want to avoid any N_y × N_y solve. Cost O(N_e N_x N_y) with no matrix inversion. |
filterax.filters.ESTKF |
Deterministic, reduced-rank | When you want exact mean preservation by construction and a modest constant-factor speedup over ETKF — the eigendecomposition is (N_e − 1)³ rather than N_e³. |
For the parametric (non-ensemble)
SquareRootKF — linear-Gaussian baselines
and twin-experiment ground truths — see the Filters page.
Note that ETKF_Livings is stochastic (the rotation draws from a PRNG key),
so it is rejected by the differentiable training
entry points, like StochasticEnKF.
Reference¶
Layer-1 sequential filter components.
Re-exports the L1 filter classes from filterax._filters._sequential so the
canonical filterax.filters.ETKF() access path matches the design docs.
Wave 4 additions:
* :class:ETKF_Livings — ETKF + mean-preserving random rotation
* :class:EnSRF_Serial — scalar serial sqrt updates
* :class:ESTKF — error-subspace transform
* :class:SquareRootKF — parametric Cholesky filter (lives in
filterax._filters._parametric for namespacing; re-exported here for
convenience).
ESTKF
¶
Bases: AbstractSequentialFilter
Error Subspace Transform Kalman Filter (Nerger et al. 2012).
Projects ETKF into the (Nₑ − 1)-dimensional error subspace via
a mean-preserving orthogonal map L ∈ ℝ^{Nₑ × (Nₑ − 1)} with
Lᵀ L = I_{Nₑ − 1} and Lᵀ 𝟙 = 0. Anomalies are rank
≤ Nₑ − 1 to begin with (their rows sum to zero), so L
captures them losslessly.
Reduced anomalies and transform precision:
Eigendecompose A = U Λ Uᵀ:
Lift back to the full ensemble:
Mean-preserving by construction; PSD analysis covariance;
eigendecomposition is (Nₑ − 1)³ rather than Nₑ³.
Source code in src/filterax/_filters/_sequential.py
794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 | |
ETKF_Livings
¶
Bases: AbstractSequentialFilter
ETKF with a mean-preserving random rotation (Livings et al. 2008).
ETKF's symmetric square root W_a = √((Nₑ − 1) T) is the unique
PSD- and mean-preserving choice, but it produces a deterministic
transform that can develop preferred directions over many cycles —
the ensemble loses rank to a small invariant subspace. Livings et
al. break this symmetry by composing with a random orthogonal
matrix:
The mean-preserving constraint Θ 𝟙 = 𝟙 keeps the analysis
mean and the rank-deficiency-against-𝟙 property; the random factor
averages out preferred-direction artefacts over time.
PRNG key handling. The constructor's self.key is the default
source of randomness; analysis(..., key=subkey) overrides it
for a single call. Pattern-match the :class:StochasticEnKF API:
if you call analysis directly inside a loop, pass a freshly
split key each cycle or you will get the same rotation every
window — which defeats the whole purpose of the Livings recipe.
Attributes:
| Name | Type | Description |
|---|---|---|
key |
PRNGKeyArray
|
Default PRNG key for the random rotation. Used when no
explicit |
Source code in src/filterax/_filters/_sequential.py
625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 | |
EnSRF_Serial
¶
Bases: AbstractSequentialFilter
Serial Ensemble Square Root Filter (Whitaker & Hamill 2002).
Processes observations one at a time with the classical W&H scalar reduced-gain formula:
No matrix inversion is required — each scalar update is an inner
product. Cost O(Nₑ Nₓ Nᵧ) total. Requires diagonal R
(uncorrelated obs); use :class:ETKF / :class:EnSRF for general
R or pre-decorrelate observations.
The implementation reapplies obs_op to the running ensemble
inside each scalar update. That keeps the serial trajectory
consistent for nonlinear H (where the relationship between
state-space and obs-space anomalies is updated by H itself, not
by linear book-keeping). Cost is O(Nᵧ × Nₑ × cost(H)) —
fractionally more than the linear-only shortcut but correct for
every H filterax supports.
Source code in src/filterax/_filters/_sequential.py
711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 | |