[R-sig-ME] allFit fails after removing object with starting values for model parameters from workspace

Ben Bolker bbo|ker @end|ng |rom gm@||@com
Thu Aug 8 15:26:30 CEST 2019


  This is not surprising, as allFit() uses update(), which tries to
re-evaluate the function ... at the very least allFit needs a
documentation update with that hint ... (I also notice at a glance that
the allFit docs seem to be incomplete anyway).

  If you say more about your workflow we might be able to find a way to
help.  (If your workflow is this simple then the answer would be "well
then don't delete theta" ...)

  cheers
    Ben Bolker


On 2019-08-08 9:06 a.m., Gerrit Eichner wrote:
> Dear lmer-experts,
> 
> if I refit a fitted model with all available optimizers AFTER
> removing the object which contains the starting values for the
> parameters of the model as in
> 
> theta <- c(1, 0.01, 0.2)
> fm <- lmer(Reaction ~ Days + (Days | Subject), data = sleepstudy,
>            start = theta)
> rm(theta)
> allFit(fm, verbose = FALSE)
> 
> none of the optimizers succeeds:
> 
> original model:
> Reaction ~ Days + (Days | Subject)
> optimizers (7): bobyqa, Nelder_Mead, nlminbwrap, nmkbw, optimx.L-BFGS-B,
> nloptwrap.NLOPT_LN_N...
> 7 optimizer(s) failed
> differences in negative log-likelihoods:
> max= -Inf ; std dev= NA
> Warning messages:
> 1: In min(nllvec) : no non-missing arguments to min; returning Inf
> 2: In max(nllvec - min(nllvec)) :
>   no non-missing arguments to max; returning -Inf
> 
> 
> If I don't remove theta from my workspace everything works fine.
> Is there a workaround for this - from my perspective - unwanted
> behaviour? (I have situations where allFit is used in a different
> environment from the one wherein the model was fit, e.g., after
> fitting the model the object which contains the fit is saved and
> later loaded in another R-session to be processed by allFit.)
> I could, of course, save theta everytime as well ... Any ideas?
> 
>  Best regards  --  Gerrit
> 
> ---------------------------------------------------------------------
> Dr. Gerrit Eichner                   Mathematical Institute, Room 212
> gerrit.eichner using math.uni-giessen.de   Justus-Liebig-University Giessen
> Tel: +49-(0)641-99-32104          Arndtstr. 2, 35392 Giessen, Germany
> http://www.uni-giessen.de/eichner
> 
> _______________________________________________
> R-sig-mixed-models using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models



More information about the R-sig-mixed-models mailing list