CI Output for BCF, ku and ke (TK)

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
Johannes Raths
Posts: 3
Joined: Wed Sep 01, 2021 11:09 am
Location: Switzerland

CI Output for BCF, ku and ke (TK)

Post by Johannes Raths »

I was modelling toxicokinetics and wanted to calculate the 95% confidence intervals (CIs) of the uptake (ku) and elimination (ke) rate constant as well as the BCF (Piw).
I tried to simply add all three parameters in the model ("Unpack parameters" in "Simplefun" and "Initial values for the model parameters" in the main script) in order to calculate the CIs of all three, however I got weird results for the BCF (Piw).

Eventually I decided to simply run two scripts, one with ke and ku, another one with ke and Piw to get all of my CIs.

If there is a smarter way to run it in one script, this could be something useful to be added to future versions :)
User avatar
Tjalling
Site Admin
Posts: 212
Joined: Wed Sep 30, 2015 9:57 am
Location: The Netherlands
Contact:

Re: CI Output for BCF, ku and ke (TK)

Post by Tjalling »

A standard 1-compartment TK model has 2 parameters, so you cannot change the model in BYOM to make it 3. You have a choice which 2 parameters to use (ke and ku, or ke and BCF, or even ku and BCF). The third variable will then be a model output. So, technically, you would need to propagate the uncertainty in 2 parameters to a model output. Parts of BYOM do that for specific output such as the LCx,t. However, there is no facility for BCF, nor any general-purpose facility (yet).

It is possible to add code to read the sample from the saved MAT file and code an ad-hoc error propagation. However, that requires quite a bit of BYOM-savvy, and can easily go wrong. The way you did it (make two model versions) certainly works, but it is a bit of double work.

There is a functionality in BYOM for using a zero-variate data point: a data point without a time vector, which is a translation of the model parameters. However, at this point, the model prediction for this point is not plotted with a CI. I explicitly excluded that in the code, and I am not sure why :mrgreen: . I will put it on my to-do list to look into this. As soon as I have a bit of time I can see if this functionality in BYOM can be epxanded.
User avatar
Johannes Raths
Posts: 3
Joined: Wed Sep 01, 2021 11:09 am
Location: Switzerland

Re: CI Output for BCF, ku and ke (TK)

Post by Johannes Raths »

Thanks a lot for the quick reply! Looking forward to the implementation :)
User avatar
Tjalling
Site Admin
Posts: 212
Joined: Wed Sep 30, 2015 9:57 am
Location: The Netherlands
Contact:

Re: CI Output for BCF, ku and ke (TK)

Post by Tjalling »

Well, it turned out to be not too complex to modify the functionality for zero-variate data points. So BYOM will now automatically plot CIs on the model prediction for the zero-variate data point, when it is available. This is only done when using the function calc_and_plot, and only when it is called with out_conf (output from calc_conf). The example file byom_bioconc_extra demonstrates how to use zero-variate data and plotting with CIs.

This functionality will appear in the next update for BYOM (we are now, as I write this, with v.6.1 as official last version). This update is not planned yet. If you like to play with this new functionality already, let me know, and I can provide you with a beta pre-release.

Note that this functionality only works for single point variables, that can be calculated in call_deri, and that do not change with the scenario in X0mat. If the estimate does change with scenario, you need to define separate zero-variate data points for each one. I have been toying with the idea to have a more generic and flexible prediction facility, but that will have to wait (probably until I get a project in which something like that is needed).
User avatar
Annika M.-D.
Posts: 19
Joined: Wed Sep 01, 2021 11:23 am
Contact:

Re: CI Output for BCF, ku and ke (TK)

Post by Annika M.-D. »

It works! Nice, thanks Tjalling :)
Post Reply