Wrong indices when setting covariance matrix

Hi!

I am using PumasEMModel, SAEM, and I have 4 parameters, I defined 3 random effects, the last parameter didn’t have any random effect. Then I tried to set a 3×3 variance-covariance matrix, but Pumas seems to want to incorporate the last parameter in the matrix and it shows:

ERROR: BoundsError: attempt to access 3×3 SMatrix{3, 3, Float64, 9} with indices SOneTo(3)×SOneTo(3) at index [4, 4]

this is my code:

inti_para = (;
tvd1=0.4, CL=7, Vc=140, mat=2.5,
Ω = (@SMatrix([
            0.9 0.1 0.1 
            0.1 0.9 0.1 
            0.1 0.1 0.9 
        ])),
σ = (0.9))

@param begin
            tvd1 ~ 1 | LogitNormal          
        end
@random begin
            CL ~ 1 | LogNormal
            Vc ~ 1 | LogNormal
            mat ~ 1 | LogNormal
        end
@covariance 3

then I moved tvd1 into the @random block and set a single variance and a 3×3 matrix and set @covariance block as 1 3, and it works, but this is not what I want, I don’t want a random effect on tvd1, so how can I avoid this issue, or fix the random effect of tvd1 at a very samll value?
Thanks!

Please share the call that raises the exception as well as the complete error message. It makes it easier for us to reason about the issue.

When using the EM algorithm, the population parameters should only affect the model through the random effects, see e.g. An EM Algorithm for Nonlinear Random Effects Models on JSTOR. Hence, parameters in the @param block are also technically random effects but their standard deviation goes to zero during the estimation procedure. If you pass initial values for the variability parameters, you therefore have to pass parameters matching the total number of parameters in @param and @random. However, you don’t have to pass initial values for variability parameters. In most cases, the fitting algorithm will be able to take care of it.

Thank you! I removed the omega in initial value tuple and now it works

this is the complete error message: