[R-sig-ME] understanding error with "profile" method of lme4a

Ben Bolker bbolker at gmail.com
Mon Apr 4 18:10:46 CEST 2011


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




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