1

I am running several Cox models, each time adding one new variable.

The primary model I ran was

model1 <- coxph(Surv(time1sec, time2sec, event) ~ gain + Buy + Lev + TP + gain:TP + SL + gain:SL + InstrumentID, data)

This worked fine, but then I wanted to add a week fixed effect to take into account the time (or week) in which a trade was opened. So I ran the following:

model2 <- coxph(Surv(time1sec, time2sec, event) ~ gain + Buy + Lev + TP + gain:TP + SL + gain:SL + InstrumentID + week, data)

When I run this model on my laptop, R crashes. When I run it on the cluster, I get the following error:

*** caught segfault ***
address 0xfffffffc00000000, cause 'memory not mapped'

Traceback:
 1: docount(y, x, weight)
 2: survConcordance.fit(y, lp, strata, weights)
 3: fitter(X, Y, strats, offset, init, control, weights = weights,     method = method, row.names(mf))
 4: coxph(Surv(time1sec, time2sec, event) ~ gain + Buy + Lev + TP + gain:TP + SL + gain:SL + InstrumentID + week, data)
aborting ...
/var/spool/gridscheduler/execd/node074/job_scripts/27524: line 28: 37078     Segmentation fault      (core dumped)

For model1 I used 8GB of RAM and it worked fine, for model2 I tried increasing it to 128 GB on the cluster but it did not work.

I am guessing it doesn't have to do with memory but instead with me adding the week variable. Is this error occurring because the week variable is correlated in some way to time1sec and time2sec, which are the open and close dates of the trade?

UPDATE I plotted week against the time1sec as shown in the graph. I know that these two variables are perfectly correlated, but my question is since the duration is also based on time2sec, can't I include week as a fixed effect? Or is this taken into account by the model via the time1sec variable?

plot-openWeek-vs-time1sec

4

0 回答 0