Alternative way of specifying dosage regimen

I am trying the example specified on introduction to pumas tutorial webpage (https://tutorials.pumas.ai/html/introduction/introduction.html). When I specified the dosage regimen as “regimen = DosageRegimen([15,15,15,15], time=[0,4,8,12])”, the output plots are identical to the ones presented on the webpage. However, when I specified dosage regimen equivalently as “regimen = DosageRegimen(15, time=0, ii=4, addl=3)”, the output plots obtained are different (especially periph and resp compartments, see below).

I am wondering what caused this difference. Any thoughts are highly appreciated.

Thanks in advance!

Dear Abhinav,

Good question. I do wonder if you are simulating that subject with the same random effects. Can you maybe share the exact code you’re running?

Best,
Patrick

hi Abhinav,

As Patrick suggested, It looks like you are simulating from a model which has random effects on the subject. This will result in a different simulation each time even for the same subject due to the randomness.

Vijay

Thanks for your responses.
I ran the same code two times one after the other, but with different versions of dosage regimen specification.
Could you please let me know how to specify a seed number in Pumas so that the simulations can be reproduced with the same random effects?

we will post a complete example later, but for now you can do

using Random
Random.seed!(123)

at the top of your script.

Note that if you are running in Pumas v0.9 or lower, and JuliaPro v1.2, you may still get a different plot each time due to default multithreading in JuliaPro. In the next release we have fixed this and using the code above at the top of your script will give you the same result every time.

1 Like