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

Almost zero interaction effect for mean error (bias) metric with delta MIM #632

Open
TobiasKAndersen opened this issue Aug 12, 2024 · 6 comments

Comments

@TobiasKAndersen
Copy link
Contributor

Hi all,

My colleagues and I are a bit confounded by our SA results, and we hope that this great community could help provide some clarifications.

During a multi-model comparison project for four 1D lake hydrodynamic models on 73 lakes, we performed a SA as well based on sampling with Latin Hybercube and analysis with Delta moment independent-method, all via SALib. In the SA, we characterized influential parameters on several different model performance metrics for instance NSE, R, RMSE and mean error (bias). In addition, we calculated parameter interaction measure (as the sum of S1, as recommended in Borgonovo et al., 2017).

Curiously, all interaction measures calculated for mean error (bias) across all models and lakes were close to zero. In contrast, we saw variation in interaction measures between other performance metrics and between hydrodynamic models (Fig 6).
Fig6

How can this be?
Is it due to the nature of mean error? Or do we have an error in our approach?

All suggestions and thoughts are very welcome!

@tupui
Copy link
Member

tupui commented Aug 12, 2024

Hi 👋

To help analyze your case, could you provide 2D subplots of inputs vs output? Pairplot from eg. seaborn. That would help visually understand what could be happening.

@TobiasKAndersen
Copy link
Contributor Author

TobiasKAndersen commented Aug 14, 2024

Of course, thanks @tupui

We are working with four hydrodynamic models: FLake, GLM, GOTM and Simstrat for 70 lakes. Here is just pairplots for Lake Stechlin for each model. X-axis holds model parameters and y-axis have performance metrics. Pairplot title is model and lake name.

Was this what you had in mind?

stechlin_pairplot-Simstrat
stechlin_pairplot-FLake
stechlin_pairplot-GLM
stechlin_pairplot-GOTM

@TobiasKAndersen
Copy link
Contributor Author

And here is for a "warm lake", Lake Kivu, where the interaction for the model FLake is high.

Kivu_pairplot-FLake
Kivu_pairplot-GLM
Kivu_pairplot-GOTM
Kivu_pairplot-Simstrat

@ConnectedSystems
Copy link
Member

ConnectedSystems commented Aug 14, 2024

Hi @TobiasKAndersen

Just wondering, how is mean error being calculated here for your whisker/barplot? Through a package or your own code?

As far as I can tell the barplots don't really align with what the pairplots are showing.

Minor general comment on the figures: I find minimising the white edge/stroke colour of each point and making the fill colour more transparent helps with legibility.

@TobiasKAndersen
Copy link
Contributor Author

Hi @ConnectedSystems

Thanks for your feedback!

mean error was calculated in R (by colleagues) with the function from the R package LakeEnsemblR as
bias <- mean((P - O), na.rm = TRUE)

So model predicted values (P) against observed values (all water temperature).

Interaction term (S_inter) was calculated in Python by sum of all S1 per model, lake and performance metric (var) (following Borgonovo et al, 2017):
sa_inter = sa_clean.groupby(by=['model', 'lake', 'var'], as_index=False)['S1'].sum()
sa_inter['S_inter'] = 1- sa_inter['S1']

We include 71 lakes in total in this study (classified into the different lake "groups" e.g. warm lakes which incl 7 lakes).

Thanks, here is the revised pairplots ;)

Kivu_pairplot-Simstrat
Kivu_pairplot-FLake
Kivu_pairplot-GLM
Kivu_pairplot-GOTM

@tupui
Copy link
Member

tupui commented Aug 16, 2024

X-axis holds model parameters and y-axis have performance metrics

So to be sure, you want to compute indices on the performance metrics? i.e. answer the question, which of my model parameters contribute to the variance of e.g. bias?

If this is the case, looking at the last plot only, the metrics seem to give a somewhat similar information besides some sign change. For R on turb and wind notably there is some heteroscedasticity.

Getting Sobol' indices on the figures, I would expect to see high values for wind (except for R) and swr. And low values for the rest.

Does that help?

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