Fixing random effect

Hello,

pkfit_v1_focei2 = fit(pk_v1,
rat_male_lowerdose_dt,
param_v1_newinitial,
constantcoef=(η[1]=0,),),
Pumas.FOCEI())

I would like to fix one of the random effects for the FOCEI estimation fitting, and I would receive an following error:
ERROR: syntax: invalid named tuple field name “η[1]” around /home/jrun/data/code/Rat_testmod/Version1.jmd:196

I even tried the following using Ω:

       fit(pk_v1,
                  rat_male_lowerdose_dt,
                  param_v1_newinitial, 
                  constantcoef=(Ω[1,1]=0,),),
                  Pumas.FOCEI())

Hope to hear the response soon. Thank you so much.

Hello,
I think you can fix your omega by defining all random effects individually rather than using PDiagDomain in param block and MvNormal in random block.
I am not sure if we can fix the subset of parameters when we use PDiagDomain.
You can define the random effects in this way.

@param begin
Ω_cl ∈ RealDomain(lower=0.0001)
Ω_vc ∈ RealDomain(lower=0.0001)

@random begin
η_cl ~ Normal(0, sqrt(Ω_cl))
η_vc ~ Normal(0, sqrt(Ω_vc))

Hi,

Thank you so much for your response. I would still like to know whether it is feasible to fix the ETA parameters to 0 (removing the random effect for that parameter) I would like to compare the models without defining the model domain.

Hello,
Please refer to this link. Estimating Parameters of Pumas Models · Pumas

Hope it helps.

@pleasetellme welcome to the community.

  1. to fix individual elements, your omegas should be written as Dawoon suggested. i.e. you cannot fix Ω[1] when you specified the random block as PDDiagDomain. (not you don’t fix the ETA, you fix the variance of that ETA distribution)
  2. Once you write individual Normal() for each Omega via a RealDomain, then you can choose to fix parameters directly in the fit function using the constantcoef, documentation for which you can find here
    e.g.
myfit = fit(mymodel, drug_x_population, drug_x_parameters, Pumas.FOCE(),
            constantcoef = (Ωcl = 0.04, ),
            optimize_fn=DefaultOptimizeFN(show_trace=false,))
1 Like

Hi,

I did how Dawoon suggested as following. How can I specify the variance covariance matrix when using naive pooled method as it is specified individually? I tried to align all of them and it would not work as wel.

@param begin
tvka ∈ RealDomain(lower=0)
tvcl ∈ RealDomain(lower=0)
tvvc ∈ RealDomain(lower=0)
tvvp ∈ RealDomain(lower=0)
tvq ∈ RealDomain(lower=0)
tvF ∈ RealDomain(lower=0)
Ω ∈ PDiagDomain(6)
Ω_ka ∈ RealDomain(lower=0.0001)
Ω_cl ∈ RealDomain(lower=0.0001)
Ω_vc ∈ RealDomain(lower=0.0001)
Ω_vp ∈ RealDomain(lower=0.0001)
Ω_q ∈ RealDomain(lower=0.0001)
Ω_F ∈ RealDomain(lower=0.0001)
σ²_prop ∈ RealDomain(lower=0)
end

Thank you so much in advance.

I have also tried listing the omegas in such way, and got an error.

I still don’t understand what are you trying to do

My apologies for not being clear. I am having a hard time figuring out how to specify the omegas after writing the individual Normal() for each omega via RealDomain.

tvka ∈ RealDomain(lower=0)
tvcl ∈ RealDomain(lower=0)
tvvc ∈ RealDomain(lower=0)
tvvp ∈ RealDomain(lower=0)
tvq ∈ RealDomain(lower=0)
tvF ∈ RealDomain(lower=0)
Ω ∈ PDiagDomain(6)
Ω_ka ∈ RealDomain(lower=0.0001)
Ω_cl ∈ RealDomain(lower=0.0001)
Ω_vc ∈ RealDomain(lower=0.0001)
Ω_vp ∈ RealDomain(lower=0.0001)
Ω_q ∈ RealDomain(lower=0.0001)
Ω_F ∈ RealDomain(lower=0.0001)
σ²_prop ∈ RealDomain(lower=0)
end

@pleasetellme Perhaps this is what you are seeking?

@param begin
   ...
    ωcl         ∈ RealDomain(lower=0.0)
    ωvc         ∈ RealDomain(lower=0.0)


end

@random begin
    ηcl        ~ Normal(0.0, ωcl)
    ηvc        ~ Normal(0.0, ωvc)
end

@pre begin
    CL  = tvcl  * exp(ηcl)
    Vc  = tvvc  * exp(ηvc)
    ...
 end

Thank you for your response. I am having a hard time figuring out how to specify the omegas when using naive.pooled(). How should I specify after omegas= ?

Naivepooled(NP) algorithms don’t need Omegas. So are you trying to see how to specify which omega to fix in NP?

Yes NP algorithm doesn’t need omegas but I believe we need to specify omegas in the code when using fit( , Pumas.NaivePooled(), omegas= HERE ).

oh… in that case, you just do

fit(...., omegas = (ωcl , ωvc))

Thank you for your response. I wonder why that method is not working. FOCE is working just fine, but I’m still having trouble trying to run Naivepooled method. Omegas are all defined but I am not sure why it is still giving me that it is not defined. :cry:

I am not sure what are you trying to do but why do you need to define omegas in your model?
Naivepooled analysis considers that all the data comes from one subject so there is no between subject variability to be accounted for in that case. Please let me know if you are trying to do something else

Yes, here is no between subject variability. Yet I believe to use Pumas.NaivePooled() function there is a omegas= condition to must add.
I am trying to figure out how to specify the omegas condition.