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

SparseInversion not as robust as Inversion #134

Open
ilopezgp opened this issue Mar 29, 2022 · 5 comments
Open

SparseInversion not as robust as Inversion #134

ilopezgp opened this issue Mar 29, 2022 · 5 comments

Comments

@ilopezgp
Copy link
Contributor

ilopezgp commented Mar 29, 2022

I tried using the SparseInversion algorithm instead of Inversion for an integration test in CEDMF.jl, and I run into a SingularException in L111.

The configuration used for the integration test is

γ = 1.0
threshold_eki = true
threshold_value = 5e-2
reg = 1e-2

In general, we are missing documentation for how to choose reg and how to make the convex optimization part of the update robust.

Stack trace:

Stacktrace:
--
  | [1] checknonsingular
  | @ /central/software/julia/1.7.0/share/julia/stdlib/v1.7/LinearAlgebra/src/factorization.jl:19 [inlined]
  | [2] checknonsingular
  | @ /central/software/julia/1.7.0/share/julia/stdlib/v1.7/LinearAlgebra/src/factorization.jl:21 [inlined]
  | [3] #lu!#146
  | @ /central/software/julia/1.7.0/share/julia/stdlib/v1.7/LinearAlgebra/src/lu.jl:82 [inlined]
  | [4] #lu#153
  | @ /central/software/julia/1.7.0/share/julia/stdlib/v1.7/LinearAlgebra/src/lu.jl:279 [inlined]
  | [5] lu (repeats 2 times)
  | @ /central/software/julia/1.7.0/share/julia/stdlib/v1.7/LinearAlgebra/src/lu.jl:278 [inlined]
  | [6] \(A::Matrix{Float64}, B::Diagonal{Float64, Vector{Float64}})
  | @ LinearAlgebra /central/software/julia/1.7.0/share/julia/stdlib/v1.7/LinearAlgebra/src/generic.jl:1142
  | [7] sparse_eki_update(ekp::EnsembleKalmanProcess{Float64, Int64, SparseInversion{Float64, Int64}}, u::Matrix{Float64}, g::Matrix{Float64}, y::Matrix{Float64}, obs_noise_cov::Matrix{Float64})
  | @ EnsembleKalmanProcesses /central/scratch/esm/slurm-buildkite/calibrateedmf-ci/depot/cpu/packages/EnsembleKalmanProcesses/OjLuD/src/SparseEnsembleKalmanInversion.jl:111
  | [8] (::EnsembleKalmanProcesses.var"#failsafe_update#26")(ekp::EnsembleKalmanProcess{Float64, Int64, SparseInversion{Float64, Int64}}, u::Matrix{Float64}, g::Matrix{Float64}, y::Matrix{Float64}, obs_noise_cov::Matrix{Float64}, failed_ens::Vector{Int64})
  | @ EnsembleKalmanProcesses /central/scratch/esm/slurm-buildkite/calibrateedmf-ci/depot/cpu/packages/EnsembleKalmanProcesses/OjLuD/src/SparseEnsembleKalmanInversion.jl:24
  | [9] update_ensemble!(ekp::EnsembleKalmanProcess{Float64, Int64, SparseInversion{Float64, Int64}}, g::Matrix{Float64}; cov_threshold::Float64, Δt_new::Float64, deterministic_forward_map::Bool, failed_ens::Nothing)
  | @ EnsembleKalmanProcesses /central/scratch/esm/slurm-buildkite/calibrateedmf-ci/depot/cpu/packages/EnsembleKalmanProcesses/OjLuD/src/SparseEnsembleKalmanInversion.jl:191

@jinlong83
Copy link
Contributor

The value of γ may be too small in this case? When the sparsity constraint is too strong, we would quickly have collapsed ensemble that could trigger singularity issue in convex optimization. I'll investigate this issue a little bit more to see if we can better guarantee the robustness.

@ilopezgp
Copy link
Contributor Author

ilopezgp commented Mar 29, 2022

The value of γ may be too small in this case? When the sparsity constraint is too strong, we would quickly have collapsed ensemble that could trigger singularity issue in convex optimization. I'll investigate this issue a little bit more to see if we can better guarantee the robustness.

That would be great, thanks! Is there any guideline we could document for the value of reg, or any heuristic to choose its value?

@jinlong83
Copy link
Contributor

The value of γ may be too small in this case? When the sparsity constraint is too strong, we would quickly have collapsed ensemble that could trigger singularity issue in convex optimization. I'll investigate this issue a little bit more to see if we can better guarantee the robustness.

That would be great, thanks! Is there any guideline we could document for the value of reg, or any heuristic to choose its value?

The value of reg corresponds to ensemble inflation and it would be ideal to keep its value small. The value of γ needs a little bit more trial and error, as we want to have a γ that leads to a sparse solution but would not significantly increase the original loss (which can be visualized in more details by checking the agreement with observation data).

@odunbar
Copy link
Collaborator

odunbar commented Sep 21, 2022

@odunbar
Copy link
Collaborator

odunbar commented Feb 5, 2024

As a continuation here, we have removed the DataMisfitController() tests as these have started leading to test failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants