I am having the following problem in a large parameter space. Let’s say I have two parameters A and B. If I constrain the range of A between 0 and 10 and B between 0 and 5, the sensitivity to A turns out higher. If I do the inverse, sensitivity to B is higher. If I make both of them between 0 and 10, then the solutions to differential equation diverge. I tried putting NaNs to divergent solutions but this impairs the subsequent calculations of sensitivity analysis since the software is not optimized for dealing with NaN values. I can create a minimum working example if needed. Does anybody dealt with a similar problem? I am open for any suggestions.
We probably just need to add an option to drop NaNs.
I can make a pull request for this. Let’s take Sobol as an example, if I understood the code correctly, we should change the function gsa_sobol_all_y_analysis
(line 160 in sobol_sensitivity.jl
):
Currently:
function gsa_sobol_all_y_analysis(method, all_y::AbstractArray{T}, d, n, Ei_estimator,
y_size, ::Val{multioutput}) where {T, multioutput}
Which should be changed to
function gsa_sobol_all_y_analysis(method, all_y::AbstractArray{T}, d, n, Ei_estimator,
y_size, ::Val{multioutput}; dropna=false) where {T, multioutput}
if dropna
all_y = all_y[.!isnan(all_y)]
end
And appropriate modifications to the function gsa
.
Would that work?
Oh sorry, obviously not so trivial since 1) one would also need to handle the design matrices; 2) if multioutput=true, having a matrix makes dropping nans very complicated. I cloned the repo and started fiddling with it. If I can implement this without breaking the existing code, I will get back here.
Follow-up to this: I opened an issue on github page for GlobalSensitivity: Handling NaNs for divergent trajectories in Sobol Method · Issue #185 · SciML/GlobalSensitivity.jl. I made a proposal that can possibly remedy the problem but don’t know if my proposal is correct or not.