[R] eha aftreg performance

Philipp Rappold
Tue, 23 Feb 2010 14:35:45 -0000

OK - I'll see if I can spare some time on the weekend to dig a bit
deeper and maybe find the issue.
(Unfortunately I cannot use a phreg model because I cannot assume a
proportional hazards assumption.)

G?ran Brostr?m wrote:
> Philipp Rappold wrote:
>> G?ran, thanks for the update, I'm just about to install it!
>>
>> Just wanted to drop you a short line about performance (as you once
>> requested):
>>
>> aftreg takes ages on my windows machine to calculate a small set of
>> 7 observations which are not even grouped together by "id".
To be a
>> bit more precise, it takes 2:40 mins on my Intel T9300 Core2 Duo @
>> 2.5 GHz. Bigger samples with about 700 observations and 6 dependent
>> variables are in the 10 minutes range.
>>
>> I just fired up my linux console (ubuntu) and calculation takes not
>> even 2 seconds here.
>
> On my laptop (ubuntu):
>
>> system.time(fit1 <- aftreg(Surv(start, stop, censor)~var1, data=td))
>    user  system elapsed
>   0.030   0.000   0.039
>
> But on Windows I can see what you see: It takes 2.5 minutes! I don't
> understand it. I can see that the time is spent in the C code (with
> Rprof), but that's all I can do on a windows machine.
>
> phreg doesn't seem to have this problem. Have you considered a
> proportional hazards model instead of an aft model?
>
> G?ran
>
>
>>
>> I've attached a screenshot of my system performance during
>> calculation, maybe that could already be a first hint (interestingly
>> I'm seeing some kind of sawtooth profile on physical memory
history).
>>
>> Generally it's not a problem for me as I can use the linux version,
>> but maybe you have an idea what makes it so slow. If I can provide
>> you with more details or help on fixing it, let me know.
>>
>> Here's the dump for reconstruction:
>>
>>> library(eha)
>>
>>> testdata
>>   start stop censor groupvar       var1      var2
>> 1     0    1      0        1 0.91663902 0.0847912
>> 2     1    2      0        1 0.60470753 0.6487798
>> 3     2    3      0        1 0.09599891 0.2195178
>> 4     3    4      1        1 0.86384189 0.6667897
>> 5     0    1      0        2 0.07747445 0.8782836
>> 6     1    2      0        2 0.44608030 0.2218685
>> 7     2    3      1        2 0.77317152 0.3813840
>>
>>> fit1 <- aftreg(Surv(start, stop, censor)~var1, data=testdata)
>>
>>> sessionInfo()
>> R version 2.9.2 (2009-08-24)
>> i386-pc-mingw32
>>
>> locale:
>>
LC_COLLATE=German_Germany.1252;LC_CTYPE=German_Germany.1252;LC_MONETARY=German_Germany.1252;LC_NUMERIC=C;LC_TIME=German_Germany.1252
>>
>>
>> attached base packages:
>> [1] splines   stats     graphics  grDevices datasets  utils
>> methods   base
>>
>> other attached packages:
>> [1] eha_1.2-13      survival_2.35-8 rcom_2.2-1      rscproxy_1.3-1
>>
>> loaded via a namespace (and not attached):
>> [1] tools_2.9.2
>>
>>
>> All the best
>> Philipp
>>
>>
>>
------------------------------------------------------------------------
>>
>