# Simulation

**URL:** https://discourse.pumas.ai/c/simulation/6.md

[Latest](https://discourse.pumas.ai/latest.md) · [Categories](https://discourse.pumas.ai/categories.md)

---

## [About the Simulation category](https://discourse.pumas.ai/t/about-the-simulation-category/70)

<div class="topic-metadata">

**Author:** [@vijay](https://discourse.pumas.ai/u/vijay)\
**Replies:** 0

</div>

---

## [Query on Simulation Setup for In-Vitro PD Model in Pumas](https://discourse.pumas.ai/t/query-on-simulation-setup-for-in-vitro-pd-model-in-pumas/1381)

<div class="topic-metadata">

**Author:** [@Sabariakilesh](https://discourse.pumas.ai/u/Sabariakilesh)\
**Replies:** 3\
**Last updated:** [February 26, 2026, 9:39am UTC](https://discourse.pumas.ai/t/query-on-simulation-setup-for-in-vitro-pd-model-in-pumas/1381 "2026-02-26T09:39:28Z")

</div>

Hej Pumas Community, I am currently working on a semi-mechanistic PD model based on in vitro OD data and have successfully translated my model from NONMEM to Pumas. Since this is in vitro data, there are no dose record…

---

## [Multiple Dose Simulation Issue](https://discourse.pumas.ai/t/multiple-dose-simulation-issue/1332)

<div class="topic-metadata">

**Author:** [@srg808](https://discourse.pumas.ai/u/srg808)\
**Replies:** 4\
**Last updated:** [January 12, 2026, 7:28pm UTC](https://discourse.pumas.ai/t/multiple-dose-simulation-issue/1332 "2026-01-12T19:28:58Z")

</div>

Hello Pumas community! I am attempting to simulate an ER model using logistic regression. The simulation runs when simulating a single dose regimen, but gives the following error when adding an additional dose. The erro…

---

## [Error in simulating a PBPK model](https://discourse.pumas.ai/t/error-in-simulating-a-pbpk-model/1198)

<div class="topic-metadata">

**Author:** [@tesh\_sutha99](https://discourse.pumas.ai/u/tesh_sutha99)\
**Replies:** 1\
**Last updated:** [July 9, 2025, 6:27am UTC](https://discourse.pumas.ai/t/error-in-simulating-a-pbpk-model/1198 "2025-07-09T06:27:12Z")

</div>

Hello Pumas community, I am trying to replicate a PBPK model for ADC. The model is running but when i try to simulate observations it is throwing a warning. It is also showing that the simulated dataframe has infinity v…

---

## [VPC for repeated time to events](https://discourse.pumas.ai/t/vpc-for-repeated-time-to-events/1163)

<div class="topic-metadata">

**Author:** [@medhat](https://discourse.pumas.ai/u/medhat)\
**Replies:** 3\
**Last updated:** [May 9, 2025, 12:18pm UTC](https://discourse.pumas.ai/t/vpc-for-repeated-time-to-events/1163 "2025-05-09T12:18:17Z")

</div>

Hello everyone, i am trying to learn Pumas and I was walking through the tutorial for TimeToEvent models ( Time To Event). I came across some issues when it comes to simulating a RTTE model. Can anyone kindly share ho…

---

## [Discrepancies in PRED values between Lognormal and Gaussian PK models](https://discourse.pumas.ai/t/discrepancies-in-pred-values-between-lognormal-and-gaussian-pk-models/1164)

<div class="topic-metadata">

**Author:** [@medhat](https://discourse.pumas.ai/u/medhat)\
**Replies:** 2\
**Last updated:** [April 4, 2025, 3:30pm UTC](https://discourse.pumas.ai/t/discrepancies-in-pred-values-between-lognormal-and-gaussian-pk-models/1164 "2025-04-04T15:30:48Z")

</div>

Hello everyone, I am comparing lognormal vs. Gaussian distributions for random effects modelling and noticed significant differences in the PRED and IPRED values between the two models when i use subject\_fits() to plot. …

---

## [Error Constant Interpolation Struct Array](https://discourse.pumas.ai/t/error-constant-interpolation-struct-array/1139)

<div class="topic-metadata">

**Author:** [@parssh.mehta](https://discourse.pumas.ai/u/parssh.mehta)\
**Replies:** 1\
**Last updated:** [February 16, 2025, 8:54pm UTC](https://discourse.pumas.ai/t/error-constant-interpolation-struct-array/1139 "2025-02-16T20:54:53Z")

</div>

Hi, I am trying to run simulations. I am getting this error (the following code was running earlier in the previous version) which I am not sure of, the error is as below: ERROR: TaskFailedException nested task er…

---

## [Simulating Model with OCC and other covariates](https://discourse.pumas.ai/t/simulating-model-with-occ-and-other-covariates/1104)

<div class="topic-metadata">

**Author:** [@farmacyst](https://discourse.pumas.ai/u/farmacyst)\
**Replies:** 1\
**Last updated:** [December 24, 2024, 2:25pm UTC](https://discourse.pumas.ai/t/simulating-model-with-occ-and-other-covariates/1104 "2024-12-24T14:25:49Z")

</div>

I’m trying to build a population for a simulation using a model which has IOV random effects modeling. But I have other covariates in the data set as well. I looked at the tutorial but, I am not able to build a populatio…

---

## [Adding covariates and simulation](https://discourse.pumas.ai/t/adding-covariates-and-simulation/1076)

<div class="topic-metadata">

**Author:** [@Anupama](https://discourse.pumas.ai/u/Anupama)\
**Replies:** 2\
**Last updated:** [October 28, 2024, 11:23am UTC](https://discourse.pumas.ai/t/adding-covariates-and-simulation/1076 "2024-10-28T11:23:02Z")

</div>

I am doing a pop pk to understand the effect of different doing regimen of the drug. I have a model developed and all the dosing regimens. Can someone please help me to add weight as covariate in it and do simulation .…

---

## [How to simulate different time points for each individuals](https://discourse.pumas.ai/t/how-to-simulate-different-time-points-for-each-individuals/1045)

<div class="topic-metadata">

**Author:** [@Pavan](https://discourse.pumas.ai/u/Pavan)\
**Replies:** 1\
**Last updated:** [June 28, 2024, 3:38pm UTC](https://discourse.pumas.ai/t/how-to-simulate-different-time-points-for-each-individuals/1045 "2024-06-28T15:38:50Z")

</div>

hi, iam trying to create a population where each individual is sampled at different time, i want one sample to be taken for each individual from time points between 1 to 12, iam not able to use rand function, as it ge…

---

## [Simulating with vcov](https://discourse.pumas.ai/t/simulating-with-vcov/575)

<div class="topic-metadata">

**Author:** [@donaldlee3](https://discourse.pumas.ai/u/donaldlee3)\
**Replies:** 36\
**Last updated:** [May 1, 2024, 7:13pm UTC](https://discourse.pumas.ai/t/simulating-with-vcov/575 "2024-05-01T19:13:40Z")

</div>

Hello, I am trying to simulate with vcov. However, I’m getting an error. Could I get some help with this? julia\> test\_sims = simobs(model\_fit, vcov(model\_fit), samples=2) Progress: 100%|██████████████████████████████…

---

## [No method matching zero](https://discourse.pumas.ai/t/no-method-matching-zero/949)

<div class="topic-metadata">

**Author:** [@MathangiCTM](https://discourse.pumas.ai/u/MathangiCTM)\
**Replies:** 10\
**Last updated:** [October 20, 2023, 5:55pm UTC](https://discourse.pumas.ai/t/no-method-matching-zero/949 "2023-10-20T17:55:47Z")

</div>

Hi, I am running a simulation using resampled individual parameter sets from a two-stage estimation. My model code is below: pilot\_fast\_2cmt\_katlag\_ehc = @model begin @param begin σ\_prop ∈ RealDomai…

---

## [Simulation time](https://discourse.pumas.ai/t/simulation-time/829)

<div class="topic-metadata">

**Author:** [@mjaber](https://discourse.pumas.ai/u/mjaber)\
**Replies:** 12\
**Last updated:** [July 24, 2023, 1:44pm UTC](https://discourse.pumas.ai/t/simulation-time/829 "2023-07-24T13:44:55Z")

</div>

Hi folks - I was wondering what we can do to increase simulation speed. Its taking ridecolus amount of time to simulate 1000 subjects. Sub = map(i-\> Subject(;id=i, events=event, covariates=(dose=dose, wt=70, sex=1,)), …

---

## [Issue in simulation using EVID = 4](https://discourse.pumas.ai/t/issue-in-simulation-using-evid-4/901)

<div class="topic-metadata">

**Author:** [@pawangpt700](https://discourse.pumas.ai/u/pawangpt700)\
**Replies:** 1\
**Last updated:** [July 18, 2023, 9:23am UTC](https://discourse.pumas.ai/t/issue-in-simulation-using-evid-4/901 "2023-07-18T09:23:00Z")

</div>

Hello, I am trying to simulate PK for a crossover study design where each subject gets 4 different formulations (for periods 1, 2, 3, and 4). I want to simulate such that the compartments reset at the time of dosing dur…

---

## [Possibility for Callbacks in PumasModel](https://discourse.pumas.ai/t/possibility-for-callbacks-in-pumasmodel/855)

<div class="topic-metadata">

**Author:** [@mjaber](https://discourse.pumas.ai/u/mjaber)\
**Replies:** 1\
**Last updated:** [April 4, 2023, 7:45pm UTC](https://discourse.pumas.ai/t/possibility-for-callbacks-in-pumasmodel/855 "2023-04-04T19:45:35Z")

</div>

Hi All, Is it possible to implement callbacks in PumasModel. e.g., when the concentration reach a specific value, the integrator stops? I was think something with simobs probably? Thanks!

---

## [Rng in sample\_randeffs error](https://discourse.pumas.ai/t/rng-in-sample-randeffs-error/849)

<div class="topic-metadata">

**Author:** [@donaldlee3](https://discourse.pumas.ai/u/donaldlee3)\
**Replies:** 1\
**Last updated:** [March 9, 2023, 5:16am UTC](https://discourse.pumas.ai/t/rng-in-sample-randeffs-error/849 "2023-03-09T05:16:06Z")

</div>

Hello, Could I get some assistance with the following code and error? rand\_effs = \[sample\_randeffs(rng=rng, sim\_model\_abs0\_1cmt\_pl\_PBE, (params\_PBE\_sim..., tvtr\_ratio = input\_tr\_ratio)) for subject in pop\] ERROR: Meth…

---

## [Simobstte error](https://discourse.pumas.ai/t/simobstte-error/805)

<div class="topic-metadata">

**Author:** [@rahul](https://discourse.pumas.ai/u/rahul)\
**Replies:** 2\
**Last updated:** [December 6, 2022, 4:18pm UTC](https://discourse.pumas.ai/t/simobstte-error/805 "2022-12-06T16:18:45Z")

</div>

Hi - I am trying to simulate a simple time to event model, but I am getting an error that I cannot read. Could someone please help me resolve this? I am using Pumas Desktop v2.0.3. Thanks! Code: ttd\_exp\_model = @model…

---

## [Simulation giving zeros instead of calculating](https://discourse.pumas.ai/t/simulation-giving-zeros-instead-of-calculating/709)

<div class="topic-metadata">

**Author:** [@KVTobin](https://discourse.pumas.ai/u/KVTobin)\
**Replies:** 1\
**Last updated:** [July 27, 2022, 12:31pm UTC](https://discourse.pumas.ai/t/simulation-giving-zeros-instead-of-calculating/709 "2022-07-27T12:31:48Z")

</div>

I am trying to simulate fraction dissolved, but the simulation is only giving zero at all time points for fdiss. Can you see why my code is not calculating fdiss correctly? # Practice developing dissolution model using…

---

## [Setting Lower Limit for dv (Dependent Variable)](https://discourse.pumas.ai/t/setting-lower-limit-for-dv-dependent-variable/728)

<div class="topic-metadata">

**Author:** [@achamzas](https://discourse.pumas.ai/u/achamzas)\
**Replies:** 3\
**Last updated:** [July 20, 2022, 7:49am UTC](https://discourse.pumas.ai/t/setting-lower-limit-for-dv-dependent-variable/728 "2022-07-20T07:49:41Z")

</div>

Hello everyone, This is my first post here and I am new to the coding world and the Pumas community. I have a question regarding simulation. My dependent variable in the model is concentration. Since I use an additive …

---

## [Customizing legend](https://discourse.pumas.ai/t/customizing-legend/721)

<div class="topic-metadata">

**Author:** [@KVTobin](https://discourse.pumas.ai/u/KVTobin)\
**Replies:** 3\
**Last updated:** [July 11, 2022, 11:20pm UTC](https://discourse.pumas.ai/t/customizing-legend/721 "2022-07-11T23:20:52Z")

</div>

Hello, I am trying to graph a scatter of my observations with a line of my predictions. Here is the code: plotted2\_Emax = @chain df\_est2\_Emax begin data(\_) \* mapping(:time =\> "Time(minutes)", :dv\_fdiss…

---

## [Model fitting giving error: gradient is exactly zero in θtd50](https://discourse.pumas.ai/t/model-fitting-giving-error-gradient-is-exactly-zero-in-td50/714)

<div class="topic-metadata">

**Author:** [@KVTobin](https://discourse.pumas.ai/u/KVTobin)\
**Replies:** 4\
**Last updated:** [June 29, 2022, 4:03pm UTC](https://discourse.pumas.ai/t/model-fitting-giving-error-gradient-is-exactly-zero-in-td50/714 "2022-06-29T16:03:10Z")

</div>

Hello, Everyone on this is very quick to respond. Thank you for your help! I am working on fitting an infusion model to a population. The code works until I try to fit the simulated population where it gives me the er…

---

## [No method matching for time](https://discourse.pumas.ai/t/no-method-matching-for-time/708)

<div class="topic-metadata">

**Author:** [@KVTobin](https://discourse.pumas.ai/u/KVTobin)\
**Replies:** 4\
**Last updated:** [June 23, 2022, 9:08pm UTC](https://discourse.pumas.ai/t/no-method-matching-for-time/708 "2022-06-23T21:08:14Z")

</div>

My program runs into a problem with the time variable when I try to run the simulation. Can you spot the problem? # Practice developing dissolution model using Pumas using Random using Pumas using PumasUtilities using …

---

## [Getting eta values during post-hoc prediction](https://discourse.pumas.ai/t/getting-eta-values-during-post-hoc-prediction/651)

<div class="topic-metadata">

**Author:** [@Dawoon](https://discourse.pumas.ai/u/Dawoon)\
**Replies:** 10\
**Last updated:** [March 22, 2022, 1:43pm UTC](https://discourse.pumas.ai/t/getting-eta-values-during-post-hoc-prediction/651 "2022-03-22T13:43:25Z")

</div>

Hello, During post-hoc prediction, I used icoef(model, population, parameter) to get individual parameters but couldn’t get eta values for each individual. Is there way to get eta values for post-hoc prediction? Also, i…

---

## [Turnover PK model simulation](https://discourse.pumas.ai/t/turnover-pk-model-simulation/645)

<div class="topic-metadata">

**Author:** [@Dawoon](https://discourse.pumas.ai/u/Dawoon)\
**Replies:** 8\
**Last updated:** [March 14, 2022, 3:22am UTC](https://discourse.pumas.ai/t/turnover-pk-model-simulation/645 "2022-03-14T03:22:17Z")

</div>

Hello, I am simulating a turnover PK model using an example shown in tutorial notebooks in pumas.ai. The model I am trying is Exercise PK49. I modified PK parameters to replicate my data. If I use 1 cmt model as shown i…

---

## [Simulating TTE Model](https://discourse.pumas.ai/t/simulating-tte-model/571)

<div class="topic-metadata">

**Author:** [@skalaria](https://discourse.pumas.ai/u/skalaria)\
**Replies:** 4\
**Last updated:** [January 3, 2022, 10:27pm UTC](https://discourse.pumas.ai/t/simulating-tte-model/571 "2022-01-03T22:27:18Z")

</div>

Hello, I am trying to simulate from a TTE model I created. However, I keep getting the error message below: “LoadError: MethodError: no method matching simobstte(::Pumas.FittedPumasModel” This my model code: brain\_tt…

---

## [Parameter having time function](https://discourse.pumas.ai/t/parameter-having-time-function/533)

<div class="topic-metadata">

**Author:** [@Dawoon](https://discourse.pumas.ai/u/Dawoon)\
**Replies:** 3\
**Last updated:** [October 20, 2021, 4:30pm UTC](https://discourse.pumas.ai/t/parameter-having-time-function/533 "2021-10-20T16:30:33Z")

</div>

Hello, Part of my model is here and I have an issue regarding ECMO\_CL in the pre block. @pre begin non\_ECMO\_CL = POPCL \* (FFM/70)^0.75 \* (0.3/SCR)^θscr \* (1/(1 + (PMA/41)^θpma)) ECMO\_CL = max\_ecmo…

---

## [Putting bounds on stochastic simulations](https://discourse.pumas.ai/t/putting-bounds-on-stochastic-simulations/520)

<div class="topic-metadata">

**Author:** [@donaldlee3](https://discourse.pumas.ai/u/donaldlee3)\
**Replies:** 1\
**Last updated:** [September 9, 2021, 7:06am UTC](https://discourse.pumas.ai/t/putting-bounds-on-stochastic-simulations/520 "2021-09-09T07:06:51Z")

</div>

Hello, I am performing stochastic simulations, and I am wondering whether it is good practice to put bounds on or truncate the parameter distributions. I ran some simulations, and some of the ka values I got, in partic…

---

## [Speeding up NCA on Simulations](https://discourse.pumas.ai/t/speeding-up-nca-on-simulations/502)

<div class="topic-metadata">

**Author:** [@donaldlee3](https://discourse.pumas.ai/u/donaldlee3)\
**Replies:** 2\
**Last updated:** [August 27, 2021, 8:48am UTC](https://discourse.pumas.ai/t/speeding-up-nca-on-simulations/502 "2021-08-27T08:48:43Z")

</div>

I am performing NCA on simulations (x1000) with varying Nsubjects (x7) and sampling scenarios (x8), and it tests out successfully on 2 reps. At 100 reps, it fails to complete in 6 hrs. Is there a way to speed up the fo…

---

## [Comparing to NONMEM (bioav & lags)](https://discourse.pumas.ai/t/comparing-to-nonmem-bioav-lags/494)

<div class="topic-metadata">

**Author:** [@dvaish](https://discourse.pumas.ai/u/dvaish)\
**Replies:** 13\
**Last updated:** [August 11, 2021, 11:09am UTC](https://discourse.pumas.ai/t/comparing-to-nonmem-bioav-lags/494 "2021-08-11T11:09:55Z")

</div>

Hello there! I am new to Pumas and have trying to validate some of my previous results from NONMEM with Pumas. I have read through the docs nearly 10 times, and I got some of my other models to work, but for some reason,…

---

## [Model instability](https://discourse.pumas.ai/t/model-instability/362)

<div class="topic-metadata">

**Author:** [@mjaber](https://discourse.pumas.ai/u/mjaber)\
**Replies:** 1\
**Last updated:** [June 4, 2020, 12:16pm UTC](https://discourse.pumas.ai/t/model-instability/362 "2020-06-04T12:16:13Z")

</div>

I received this warning after doing a simulation: \> ┌ Warning: Automatic dt set the starting dt as NaN, causing instability. \> └ @ OrdinaryDiffEq ~/.juliapro/JuliaPro\_v1.3.1-3/packages/OrdinaryDiffEq/5igHh/src/solve.jl:…

[Next page](https://discourse.pumas.ai/c/simulation/6.md?page=1)
