[R-sig-ME] simulate.lme (nlme)
bates at stat.wisc.edu
Thu Sep 27 16:21:25 CEST 2007
Your transcript looks peculiar. It shows require(lme) and you end up
with the nlme package attached. Does that really work or is it a
The reason for the small negative difference in the likelihood values
is because of convergence on the boundary. It is possible for the
difference in the negative log-likelihoods of the alternative and null
models fit to the same data to be zero. This corresponds to the
situation where the MLE or REML estimate of one of the variance
components in the alternative model is zero. When using a numerical
optimization technique that difference will not come out to be exactly
zero, especially given the way that the optimization is done in nlme
package, so you end up with a very small difference that can be
negative or positive.
On 9/26/07, Andrzej Galecki <agalecki at umich.edu> wrote:
> Dear All,
> simulate.lme generates an object (list) containing the MLs (and REMLs)
> for null and alternative models, fitted to simulated data. Since models
> are nested and are fitted to the same data we anticipate that elements
> of the vector difx containing ML differences , i.e. object$alt$ML -
> objectnull$ML, are positive.
> In the example below this difference is calculated for 30 simulations.
> I am wondering why some of the elements in difx vector are less than zero.
> Thank you
> Andrzej Galecki
> University of Michigan
> PS. Thank you Professor Bates for your response to my previous question.
> > require(lme)
> > sessionInfo()
> R version 2.5.0 (2007-04-23)
> LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
> States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252
> attached base packages:
>  "stats" "graphics" "grDevices" "utils" "datasets"
> "methods" "base"
> other attached packages:
> lattice nlme
> "0.15-4" "3.1-80"
> > orthSim <-simulate.lme(list(fixed = distance ~ age, data = Orthodont,
> + random = ~ 1 | Subject), nsim=30, seed=12345, m2 = list(random = ~ age
> | Subject))
> > difx <- orthSim$alt$ML - orthSim$null$ML
> > range(difx)
>  -0.006097405 5.222863611
> R-sig-mixed-models at r-project.org mailing list
More information about the R-sig-mixed-models