You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi everyone, thanks for developing PKPDposterior and PKPDsim. Both are great tools!
I have a minor concern regarding the implementation of the combined RUV error model. I am not entirely sure if my concern is justified but I'll just put it up for discussion.
The following will be based on the vancomycin example page from the docs. It relies on the Thomson et al. model (pub). They report a standard deviation for the additive RUV part of 1.6 mg/mL and 15% for the proportional RUV part. Thus, in the example the error terms are defined as list(prop = 0.15, add = 1.6) within
There are no further manipulations or calculations involved and we directly jump to the likelihood statement and the simulated posterior distributions:
Since ruv_prop_pk is a CV in decimal units we should get a standard deviation for ruv_prop_pk * ipred_obs_pk. And ruv_add_pk is already a standard deviation. For the likelihood and sampling statements stan expects the standard deviation of the respective distribution (ref). So we need to find the overall standard deviation of the normal distribution at the respective concentration of ipred_obs_pk. However, variance, not standard deviation, is additive. Thus, to my understanding simply adding the proportional standard deviation (= ruv_prop_pk * ipred_obs_pk) and the additive standard deviation ruv_add_pk to get the joint standard deviation is invalid. We need to first transform the SD's back to variances, add them together and then transform the resulting variance back to the SD domain. Instead of
$$\sigma = cv \cdot ipred + add$$
we would need to calculate the standard deviation by
$$\sigma = \sqrt{(cv \cdot ipred)^2 + (add)^2}$$
I was initially not sure how big the difference between both calculations are so I perfomed a small simulation with varying magnitudes of additional and proportional errors:
The relative difference between both calculation methods ranges somewhere between 0.5 % and 41 % depending on the magnitude of prop and add:
The current implementation leads to higher standard deviations than the sqrt method, thus the MCMC sampler would be more prior driven and less influenced by the likelihood/data.
Again, I don't want to rule out that I just have a misunderstanding somewhere or that I may not have fully grasped the implementation in the code. Happy to hear your opinion on this.
The text was updated successfully, but these errors were encountered:
Hi everyone, thanks for developing PKPDposterior and PKPDsim. Both are great tools!
I have a minor concern regarding the implementation of the combined RUV error model. I am not entirely sure if my concern is justified but I'll just put it up for discussion.
The following will be based on the vancomycin example page from the docs. It relies on the Thomson et al. model (pub). They report a standard deviation for the additive RUV part of 1.6 mg/mL and 15% for the proportional RUV part. Thus, in the example the error terms are defined as
list(prop = 0.15, add = 1.6)
withinand the resulting list object
data
has stored:The resulting stan model file (generated with
write_stan_model()
) directly takes theruv_prop_pk
andruv_add_pk
as input in thedata{}
block:There are no further manipulations or calculations involved and we directly jump to the likelihood statement and the simulated posterior distributions:
Since
ruv_prop_pk
is a CV in decimal units we should get a standard deviation forruv_prop_pk * ipred_obs_pk
. Andruv_add_pk
is already a standard deviation. For the likelihood and sampling statements stan expects the standard deviation of the respective distribution (ref). So we need to find the overall standard deviation of the normal distribution at the respective concentration ofipred_obs_pk
. However, variance, not standard deviation, is additive. Thus, to my understanding simply adding the proportional standard deviation (=ruv_prop_pk * ipred_obs_pk
) and the additive standard deviationruv_add_pk
to get the joint standard deviation is invalid. We need to first transform the SD's back to variances, add them together and then transform the resulting variance back to the SD domain. Instead ofwe would need to calculate the standard deviation by
I was initially not sure how big the difference between both calculations are so I perfomed a small simulation with varying magnitudes of additional and proportional errors:
The relative difference between both calculation methods ranges somewhere between 0.5 % and 41 % depending on the magnitude of prop and add:
The current implementation leads to higher standard deviations than the sqrt method, thus the MCMC sampler would be more prior driven and less influenced by the likelihood/data.
Again, I don't want to rule out that I just have a misunderstanding somewhere or that I may not have fully grasped the implementation in the code. Happy to hear your opinion on this.
The text was updated successfully, but these errors were encountered: