Sensitivity analysis function

For all your discussions and questions on modelling software, including BYOM. Note that this is NOT a help desk. Feel free to post requests for new BYOM functionality.
Post Reply
User avatar
Annika M.-D.
Posts: 19
Joined: Wed Sep 01, 2021 11:23 am
Contact:

Sensitivity analysis function

Post by Annika M.-D. »

Hi Tjalling and DebTox community,

I would like to use the sensitivity analysis function in BYOM.

Code: Select all

calc_localsens(par,opt_sens)
I used it during the course, and unfortunately, I don't remember all of it anymore. Thus, I was wondering if there is documentation of this function somewhere that I could consult for examples and options? (Of course I mean anything other than the function description itself, I will take that as a last resort :D )

My starting point is the byom_logistic_sim.m script, and it seems to run fine with my model. I just struggle a bit with interpreting the results. So, an example or some deeper understanding of how the function works would be a great help!

Cheers,
Annika
User avatar
Tjalling
Site Admin
Posts: 210
Joined: Wed Sep 30, 2015 9:57 am
Location: The Netherlands
Contact:

Re: Sensitivity analysis function

Post by Tjalling »

Hi Annika,

Perhaps I should have, but I haven't documented the BYOM functions, other than the lavish commenting of the code. Struggling with the interpretation of sensitivity analysis is normal, especially when it is a dynamic model that was fitted. I would say that such a sensitivity analysis is, in most cases, pretty useless. But, there will be models and applications were it would be useful, so that's why the functionality in BYOM is there.

What is perhaps helpful is to take a look at the GUTS e-book, Section 7.5. That shows/discusses various sensitivity analyses for a GUTS case study. There is also an example in a recent DEB-TKTD paper (Jager et al, 2023, in the SI, see https://doi.org/10.1016/j.ecolmodel.2022.110187).

The local sensitivity analysis is, in its nature, pretty straightforward: relative change in model output per relative change in a parameter's value. Trouble starts when you have many parameters, many endpoints, and endpoints that change over time.
User avatar
Annika M.-D.
Posts: 19
Joined: Wed Sep 01, 2021 11:23 am
Contact:

Re: Sensitivity analysis function

Post by Annika M.-D. »

Hi Tjalling,

I worked through the function today and it wasn't that bad actually. I was more thrown off by the code part for the plotting :oops:, but eventually I understood the function and figured out how to adjust the settings :mrgreen: .

The model I am doing the SA for is a "new" model, so I am just trying to get a feeling for the importance of the different model parameters and thought this will be good to include in the supplement of the model publication too.

Thanks for the pointers to some reading material! What I am getting from the E-Book is that I should look at the absolute change of survival to avoid misinterpreting a high sensitivity at a point where the survival is already too low for realistic considerations. Although in the DEB-tktd paper I see you show the relative sensitivity for survival. Any reason for that? And could you also elaborate on this choice for the damage state maybe?

These examples are already quite helpful, thank you! :)
User avatar
Tjalling
Site Admin
Posts: 210
Joined: Wed Sep 30, 2015 9:57 am
Location: The Netherlands
Contact:

Re: Sensitivity analysis function

Post by Tjalling »

I think I wanted to avoid additional complexity in the paper, so I kept the relative sensitivity for survival. It does not become really problematic here as survival does not get very close to zero. What is your question on damage? Why I selected that endpoint for SA or why I did not go for absolute sensitivity?

Good that you managed to follow the code here. You are right that, for a new model, SA can be quite useful in the model development phase.
User avatar
Annika M.-D.
Posts: 19
Joined: Wed Sep 01, 2021 11:23 am
Contact:

Re: Sensitivity analysis function

Post by Annika M.-D. »

Great, thanks for your answer!

Regarding damage, I was asking about the choice in the paper of using relative sensitivity. I expected the same line of argumentation you used for survival (i.e., GUTS e-book, Section 7.5 ) also applies to damage. However, this is not discussed in the book or the paper. Thus, I doubted if my expectation was wrong, i.e., due to the argument that the change of damage is important even at low levels? Or maybe I am overlooking something else?

And now I am also interested in your answer regarding using damage as an endpoint for the SA :mrgreen:
User avatar
Tjalling
Site Admin
Posts: 210
Joined: Wed Sep 30, 2015 9:57 am
Location: The Netherlands
Contact:

Re: Sensitivity analysis function

Post by Tjalling »

Annika M.-D. wrote: Mon Dec 05, 2022 11:31 am I expected the same line of argumentation you used for survival (i.e., GUTS e-book, Section 7.5 ) also applies to damage. However, this is not discussed in the book or the paper. Thus, I doubted if my expectation was wrong, i.e., due to the argument that the change of damage is important even at low levels? Or maybe I am overlooking something else?
Hmm, that's a good point. I didn't consider that. This could be an issue when damage is very low, for some part of the time vector. Using the 'absolute scaling' would not be my first choice to address this, though. Reason is that damage does not scale as nicely as survival probability (which is, obviously, always between 0 and 1). However, it is good to keep this in mind.
Annika M.-D. wrote: Mon Dec 05, 2022 11:31 am And now I am also interested in your answer regarding using damage as an endpoint for the SA :mrgreen:
Ha, no particular reason other than that it is one of the state variables, and for completeness sake, it has to be in there. Also, it shows that kd has an effect, even though this is less visible from the other state variables.
User avatar
Annika M.-D.
Posts: 19
Joined: Wed Sep 01, 2021 11:23 am
Contact:

Re: Sensitivity analysis function

Post by Annika M.-D. »

Great, thanks for the exchange, Tjalling!
Post Reply