Skip to content

Simulation of nlme models

1 message · Jesus Maria Frias Celayeta

#
Hi all,

I've observe a behaviour of predict for 2 level nlme objects that is a bit
unexpected.
If we want to make a level 1 prediction for a 2 level nlme with newdata I
get NA
The toy example (I've got other models that haven't worked either)
library(nlme)
fm1 <- nlme(current ~ A + B * cos(w * voltage + pi/4),
            data = Wafer,
            fixed = list(A ~ voltage + I(voltage^2), B + w ~ 1),
            random = list(Wafer = pdDiag(list(A ~ voltage + I(voltage^2),
                                              B + w ~ 1)),
                          Site = pdDiag(list(A ~
                                               voltage+I(voltage^2),
                                             B ~ 1))),
            start = c(-4.255, 5.622, 1.258,
                      -0.09555, 4.5679))
summary(predict(fm1,newdata=Wafer,level=1))

I'm trying to make simulations using nlme objects and if someone had a hint
on how to develop simulations from random effect distributions using nlme
objects. In my case I'm trying to assess effect of variability (my random
effects) and uncertainty on the prediction of the model.

I've found some examples of bootstrapping but they seem to work only in
perfectly balanced data (same units in all level 1, same number of samples
within level 2 cases).

https://stats.stackexchange.com/questions/232928/non-linear-mixed-model-nlme-with-nested-random-effect-do-not-know-how-to-incl

Any hint will be appreciated!

regards,

Jesus


-- 
[image: turn on images] <https://www.tudublin.ie/>

Jesus Maria Frias Celayeta

Professor and Academic Leader ESHI

City Campus
________________________________________

? +353 1 402 5410  ? +353 87 9697289  ? tudublin.ie

OT Baile ?tha Cliath - Environmental Sustainability and Health Institute,
Grangegorman Campus, D07 H6K8, Ireland