[R] absurd computiation times of lme

Christof Meigen christof at nicht-ich.de
Fri Oct 11 14:32:24 CEST 2002


Hi,

i've been trying to apply the lme apprach to growth curves
of children, but lme keeps running for ever and ever as
soon as I use a reasonable basis.

First Example:
Data are 39 boys from the Berkeley growth study, each one 
measured 31 times at the ages of
1.00  1.25  1.50  1.75  2.00  3.00  4.00  5.00  6.00  7.00  8.00  8.50
9.00  9.50 10.00 10.50 11.00 11.50 12.00 12.50 13.00 13.50 14.00 14.50
15.00 15.50 16.00 16.50 17.00 17.50 18.00

from experience we know that a bspline basis with at least 12 to 15
knots is needed to model a complete growth curve. I take the spline
basis matrix as both fixed and random effect (not forgetting the
-1, since the intercept is included in the splines).

When I use 3 knots (5 parameters), computation time is about
5 Minutes on a 750MHz machine. The fitting makes sense but
is very bad due to the lack of flexibility. 4 knots take
27 Min to compute and 5 knots take more than 5 hours
(I interrupted after that). 

I played around with pdMat, but actually it does not make sense
to restrict the variance - co-varience matrix.

Second example:

In this case, we have about 800 children with measurements
between 0 and 2.5 years. Unfortunatly, the number of the 
measurements as well as the timing differs a lot, it is only
guranteed that each child is measured at least once in all
of the 5 first quarters. 

Chosing a model like height ~ age, like in the Oxboys example
from "Mixed Effext Models in S and S-PLUS" does not make
sense since growth velocity changes rapidly in the first 
two years. So, I sticked to the spline approach, since I thought,
that 3 knots would suffice this time. 

Unfortunatly, the computation would not stop after
more than 10 hours. Taking less children doesn't change much, and
I can't use less knots. 

Although I don't expect reasonable results from that, but even with
only three children (as below) the computation wouldn't stop soon.

Data looks like below, B1..B5 are the basis matrix for the
spline basis, and I use 

kidGroup <- groupedData(height ~ B1+B2+B3+B4+B5 -1 | Id, data=kids)
fm <- lme(kidGroup)


Using a model like
kidGroup <- groupedData(height ~ sqrt(age) | Id, data=kids)

works very fast, but the model is not appropriate and the
fitting is bad. 

What is the reason for this exponential-lookking increase in
computation time and is there any way to overcome that?

Or are there more clever approaches for this data?

Thanks in advance,
        Christof


      Id  age height   B1     B2      B3     B4     B5
1  16162 0.10   56.6 0.7786 0.2120 0.0090 0.0001 0.0000
2  16162 0.21   59.4 0.5759 0.3852 0.0375 0.0011 0.0000
3  16162 0.36   62.3 0.3609 0.5325 0.1005 0.0059 0.0000
4  16162 0.51   64.5 0.2074 0.5937 0.1817 0.0169 0.0000
5  16162 0.62   66.9 0.1280 0.5944 0.2470 0.0305 0.0000
6  16162 0.71   68.8 0.0806 0.5728 0.3006 0.0458 0.0000
7  16162 0.98   72.0 0.0100 0.4293 0.4400 0.1204 0.0000
8  16162 1.15   74.9 0.0005 0.3139 0.4909 0.1946 0.0000
9  16162 1.48   75.8 0.0000 0.1358 0.4554 0.4024 0.0062
10 16162 1.79   79.5 0.0000 0.0458 0.3006 0.5728 0.0806
11 16162 1.94   81.0 0.0000 0.0224 0.2111 0.5981 0.1681

12 16216 0.10   54.5 0.7786 0.2120 0.0090 0.0001 0.0000
13 16216 0.18   58.0 0.6272 0.3439 0.0281 0.0007 0.0000
14 16216 0.33   64.2 0.3986 0.5105 0.0861 0.0045 0.0000
15 16216 0.42   68.3 0.2927 0.5663 0.1314 0.0094 0.0000
16 16216 0.54   69.8 0.1832 0.5972 0.1993 0.0201 0.0000
17 16216 0.70   73.2 0.0851 0.5761 0.2947 0.0439 0.0000
18 16216 0.82   76.0 0.0407 0.5255 0.3632 0.0705 0.0000
19 16216 1.05   78.5 0.0040 0.3820 0.4656 0.1481 0.0000
20 16216 1.26   81.5 0.0000 0.2440 0.4999 0.2560 0.0000
21 16216 1.32   81.5 0.0000 0.2103 0.4954 0.2940 0.0001
22 16216 1.52   85.2 0.0000 0.1204 0.4400 0.4293 0.0100
23 16216 1.90   89.5 0.0000 0.0276 0.2350 0.5967 0.1406

24 16233 0.09   55.3 0.7991 0.1933 0.0074 0.0000 0.0000
25 16233 0.32   64.8 0.4118 0.5024 0.0815 0.0041 0.0000
26 16233 0.51   68.4 0.2074 0.5937 0.1817 0.0169 0.0000
27 16233 0.59   69.5 0.1471 0.5974 0.2290 0.0262 0.0000
28 16233 0.91   75.4 0.0201 0.4742 0.4091 0.0964 0.0000
29 16233 1.16   78.5 0.0003 0.3072 0.4925 0.1997 0.0000
30 16233 1.34   82.9 0.0000 0.1997 0.4925 0.3072 0.0003
31 16233 1.94   86.7 0.0000 0.0224 0.2111 0.5981 0.1681
32 16233 2.03   88.6 0.0000 0.0132 0.1589 0.5848 0.2429
33 16233 2.37   90.5 0.0000 0.0002 0.0150 0.2652 0.7193
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list