Setting Lower Limit for dv (Dependent Variable)

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 error that is quite significant,when doing the simulation some of the observed concentrations take negative values.

Is there a way to specify that the dependent variable can only be positive or have a lower limit as we do in the @param block for the parameters? It wouldn’t be realistic to show that we observed a negative value for the measured concentration.

Right now I filter the results by changing the values of the negative values with a positive constant, but is there a better way to do it?

I have attached the model used and some of the results:

Thank you very much in advance!

In your derived block, you can truncated the output (PumasModel-Error models · Pumas):

dv ~ @. truncated(Normal(cp, sqrt(σ²_add)), lower_lim, upper_lim)

lower_lim can be a number greater than 0 and upper_lim can be Inf

2 Likes

That’s exactly what I needed, Thanks!!!

Also you would probably need to use LaplaceI() instead of FOCE(), because of the truncated distribution in your likelihood.

1 Like