[R-sig-ME] understanding error with "profile" method of lme4a
Douglas Bates
bates at stat.wisc.edu
Wed Apr 6 20:16:29 CEST 2011
On Mon, Apr 4, 2011 at 11:10 AM, Ben Bolker <bbolker at gmail.com> wrote:
> Darren Norris <doon75 at ...> writes:
>
>> Can anyone suggest how to resolve the following error -
>> I can't see anything in the presentations (
>> http://lme4.r-forge.r-project.org/slides/2011-03-16-Amsterdam/ )
> to suggest what I am doing wrong:
>>
>> data is available here:
>> http://cid-f0a9fa3480208398.office.live.com/
> self.aspx/lmeData/DarrensSpace.RData
>>
>> library("lme4a")
>> pr1<-profile(fmer2f<-lmer(yall~yearSeason+sun+
> total_precip_trip+mean_temp_trip+surveyArea+
> obscat+hour_period+(1|yearMonth),REML=FALSE,data=df.p))
>>
>> #Erro em x[ndat + (1L:deg) - deg] :
>> #somente 0's podem ser usados junto com subscritos negativos
>> #Calls: profile ... interpSpline.formula ->
> interpSpline -> interpSpline.default
>>
>> Tanslation: only 0's can be used together with negative subscripts.
>>
>> Many thanks (session info below),
>> Darren
>>
>> R version 2.12.2 (2011-02-25)
>> Platform: x86_64-unknown-linux-gnu (64-bit)
>>
>
>> attached base packages:
>> [1] stats graphics grDevices utils datasets methods base
>>
>> other attached packages:
>> [1] lme4a_0.999375-65 MatrixModels_0.2-1 minqa_1.1.15 Rcpp_0.9.2
>> [5] Matrix_0.999375-48 lattice_0.19-17 rkward_0.5.4
>>
>
> Thanks for the reproducible example.
>
> It looks like I have the same package versions as you (except
> Rcpp_0.9.2.1 -- and a different locale) -- but I get a different
> error message:
>
> Error in na.fail.default(data.frame(x = as.numeric(obj1),
> y = as.numeric(obj2))) :
> missing values in object
> In addition: Warning message:
> In sqrt(ores$fval - base) : NaNs produced
>
> Looking at summary(fmer2f), it seems that your estimate for
> the random effect variance is zero. In principle profiling still
> ought to work, but I can imagine that could cause problems.
Indeed it does. I haven't been able to work out how to handle that case.
> Will try to see what's going on here and whether things can
> be made more robust. (The first thing will probably be to make
> up a small simulated example where the RE variance estimate comes
> out to zero, to see if the guess is correct/whether it's a universal
> problem in this case.)
The Dyestuff2 data set, which is simulated data, provides such an
example. Box and Tiao wrote that they assume such data occur in
practice - it's just that they are never published because they fail
to show an effect.
> I would also recommend spending some more time looking at your
> data and at the fit to see that everything seems to make sense
> (outliers, blocks with extreme values, very strong parameter
> correlations, etc.) That won't fix the problem, but having
> numerical difficulties is sometimes an indicator that the data
> are wonky (and sometimes not).
>
> Ben Bolker
>
> _______________________________________________
> R-sig-mixed-models at 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