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) locale: [1] LC_CTYPE=pt_BR.UTF-8 LC_NUMERIC=C [3] LC_TIME=pt_BR.UTF-8 LC_COLLATE=pt_BR.UTF-8 [5] LC_MONETARY=pt_BR.UTF-8 LC_MESSAGES=pt_BR.UTF-8 [7] LC_PAPER=pt_BR.UTF-8 LC_NAME=pt_BR.UTF-8 [9] LC_ADDRESS=pt_BR.UTF-8 LC_TELEPHONE=pt_BR.UTF-8 [11] LC_MEASUREMENT=pt_BR.UTF-8 LC_IDENTIFICATION=pt_BR.UTF-8 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 loaded via a namespace (and not attached): [1] codetools_0.2-8 grid_2.12.2 lme4_0.999375-39 nlme_3.1-98 [5] splines_2.12.2 stats4_2.12.2 tools_2.12.2
understanding error with "profile" method of lme4a
3 messages · Darren Norris, Ben Bolker, Douglas Bates
2 days later
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. 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.) 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
2 days later
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