From 0dc3f2fb2187e531a2b2a1ae5aa9086b1f0800cc Mon Sep 17 00:00:00 2001 From: larsevj Date: Wed, 8 Jan 2025 12:20:28 +0100 Subject: [PATCH] Check all singulars --- src/ert/analysis/misfit_preprocessor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ert/analysis/misfit_preprocessor.py b/src/ert/analysis/misfit_preprocessor.py index cea09c69774..976c7393742 100644 --- a/src/ert/analysis/misfit_preprocessor.py +++ b/src/ert/analysis/misfit_preprocessor.py @@ -42,7 +42,7 @@ def get_nr_primary_components( # We compute the cumulative sum of these, then divide by their total sum to get the # cumulative proportion of variance explained by each successive component. variance_ratio = np.cumsum(singulars**2) / np.sum(singulars**2) - return max(len([1 for i in variance_ratio[:-1] if i < threshold]), 1) + return max(len([1 for i in variance_ratio if i < threshold]), 1) def cluster_responses(