From 7b1210833ea2499ef07d5d8578da73d8481aaee6 Mon Sep 17 00:00:00 2001 From: Feda Curic Date: Thu, 23 Nov 2023 08:49:36 +0100 Subject: [PATCH] Remove unused alpha from perturb_observations --- src/iterative_ensemble_smoother/esmda.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/iterative_ensemble_smoother/esmda.py b/src/iterative_ensemble_smoother/esmda.py index 3f83cde5..de8ef9eb 100644 --- a/src/iterative_ensemble_smoother/esmda.py +++ b/src/iterative_ensemble_smoother/esmda.py @@ -227,7 +227,7 @@ def assimilate( # a zero cented normal means that y := L @ z, where z ~ norm(0, 1) # Therefore, scaling C_D by alpha is equivalent to scaling L with sqrt(alpha) size = (num_outputs, num_ensemble) - D = self.perturb_observations(size=size, alpha=self.alpha[self.iteration]) + D = self.perturb_observations(size=size) assert D.shape == (num_outputs, num_ensemble) # Line 2 (c) in the description of ES-MDA in the 2013 Emerick paper @@ -291,7 +291,7 @@ def compute_transition_matrix( # or # X += X @ K - D = self.perturb_observations(size=Y.shape, alpha=alpha) + D = self.perturb_observations(size=Y.shape) inversion_func = self._inversion_methods[self.inversion] return inversion_func( alpha=alpha, @@ -303,9 +303,7 @@ def compute_transition_matrix( return_K=True, # Ensures that we don't need X ) - def perturb_observations( - self, *, size: Tuple[int, int], alpha: float - ) -> npt.NDArray[np.double]: + def perturb_observations(self, *, size: Tuple[int, int]) -> npt.NDArray[np.double]: """Create a matrix D with perturbed observations. In the Emerick (2013) paper, the matrix D is defined in section 6. @@ -315,10 +313,6 @@ def perturb_observations( ---------- size : Tuple[int, int] The size, a tuple with (num_observations, ensemble_size). - alpha : float - The covariance inflation factor. The sequence of alphas should - obey the equation sum_i (1/alpha_i) = 1. However, this is NOT enforced - in this method call. The user/caller is responsible for this. Returns -------