Skip to content
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

Remove unused alpha from perturb_observations #178

Merged
merged 1 commit into from
Nov 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions src/iterative_ensemble_smoother/esmda.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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.
Expand All @@ -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
-------
Expand Down