I just started playing around with Pumas, so it may very well be that I didn’t find the right convenience function.
I am wondering whether there is a way for NLME models to also get estimates or chain traces for the individual subject parameters. For example for the tutorial model
mymodel = @model begin @param begin tvcl ∈ RealDomain(lower=0, init = 1.0) tvv ∈ RealDomain(lower=0, init = 20) tvka ∈ RealDomain(lower = 0, init= 1) Ω ∈ PDiagDomain(init=[0.09,0.09, 0.09]) σ_prop ∈ RealDomain(lower=0,init=0.04) end @random begin η ~ MvNormal(Ω) end @pre begin CL = tvcl * (Wt/70)^0.75 * exp(η) Vc = tvv * (Wt/70) * exp(η) Ka = tvka * exp(η) end @covariates Wt @dynamics Depots1Central1 #@dynamics begin # Depot' = -Ka*Depot # Central' = Ka*Depot - (CL/V)*Central #end @derived begin cp = @. 1000*(Central / Vc) dv ~ @. Normal(cp, sqrt(cp^2*σ_prop)) end end
You can sample from the posterior doing something like this
result = fit( mymodel, data, param, Pumas.BayesMCMC(); nsamples=2000, nadapts=1000) chains = Pumas.Chains(result)
However the Pumas.Chains method only returns the traces for the population parameters. I am interested in the individual η for the Subjects…
Looking into the result.chain it seems that the traces do exist, but it’s not obvious how the traces map to the parameters. Is there any way to clarify that for me or is there maybe even a convenience method to extract also the individual parameters (I was going to try the param_map in the Pumas.Chains, but I am not sure how the Subject ηs would be called)?
Thanks a lot in advance! (Pumas is really great to work with btw!)