How to specify weights (wts) in MixedModels.jl?

Hi,

I specified a multilevel longitudinal model in MixedModels.jl. I am having a heteroscedasticity issue, for which I’d like to try to weight observations.

So, the unweighted model:

fit(MixedModel,@formula(maxtrop~1+time*glucose+(time|mr/anest)),d,REML=false)

Unit weighting works (3577 is the row count of the dataset):

fit(MixedModel,@formula(maxtrop~1+time*glucose+(time|mr/anest)),d,wts=uweights(3577),REML=false)

… but, I can’t make it further than that. Any other spec results in the following error

Initial objective evaluation failed, rescaling initial guess and trying again.
Failure of the initial evaluation is often indicative of a model specification that is not well supported by the data and/or a poorly scaled model.

I tried, among others:

wts=aweights(float.(rand([1,2,3],3577)))
wts=aweights(rand(Float64,3577))

I don’t know if it might be of importance, but there is almost no signal in the data. The unweighted model results:

Linear mixed model fit by maximum likelihood
 maxtrop ~ 1 + time + glucose + time & glucose + (1 + time | mr) + (1 + time | mr & anest)
    logLik   -2 logLik      AIC         AICc        BIC     
  23762.1125 -47524.2251 -47502.2251 -47502.1510 -47434.2200

Variance components:
              Column    Variance   Std.Dev.    Corr.
mr & anest (Intercept)  0.05686690 0.23846781
           time         0.00000000 0.00000000 -1.00
mr         (Intercept)  0.07487753 0.27363758
           time         0.00000000 0.00000000 +1.00
Residual                0.00000001 0.00009071
 Number of obs: 3577; levels of grouping factors: 482, 477

  Fixed-effects parameters:
─────────────────────────────────────────────────────────
                       Coef.  Std. Error      z  Pr(>|z|)
─────────────────────────────────────────────────────────
(Intercept)     -0.150825     0.0165952   -9.09    <1e-18
time            -2.40061e-9   5.61142e-6  -0.00    0.9997
glucose          8.79342e-10  8.81333e-7   0.00    0.9992
time & glucose   2.37489e-10  6.75191e-7   0.00    0.9997
─────────────────────────────────────────────────────────

Any help would be greatly appreciated. Thanks!