Notes 2014-07-31

IDEAS/SUGGESTIONS

non-invertible penalties into coxme

Two possible approaches that might work with coxme as it is come to mind:

  1. replace the zero eigenvalues of the penalties with very small non-zeroes \( \rightarrow \) that instantly gives you positive definiteness, at the cost of changing the pen. slightly. E.g. for a first-differences penalty, this adds a small ridge penalty. This is also the idea behind mgcv's cs and ts bases (c.f. Marra/Wood “Practical variable selection for GAMs”) and the pss-constructor defined in refund() for ff -terms. Those should work with coxme. If you make the replacement eigenvalues just barely large enough to ensure numerical full rank (i.e., very very large variance versus infinite variance on the unpenalized function space), the change shouldn't really affect the fits for non-pathological cases.
  2. do the classic mixed model decomposition as in Section 6.6.1 of Wood (2006) and split off the unpenalized parts.

use tv(...) to indicate time-varying terms in the pcox-formula

don't repeat all my pffr()-mistakes

some things I would do differently if I were to start over:

ISSUES

simSurvTVC.R

time varying terms via pcox():

  1. pcox(Surv(time,event) ~ X1 + tt(X2), data=data1) gives a time constant term for X2 unless you also specify tt=function(x,t,...) x*s.cox(t), but then why have the pcox wrapper at all – that's the same syntax as for coxph? (also see 2nd idea above)
  2. lf.vd() & af.vd() don't exist (yet?) in refund or refundDevel, AFAICS.
  3. special term type names don't correspond to those in pcox.tex
  4. for the formula interface to work like the spec in pcox.tex, I think we'll need two steps following l. 87: one to get all the time-varying terms and to check what kind they are (linear/nonlinear scalar, linear/nonlinear concurrent, linear /nonlinear functional (vd yes/no), linear/nonlinear historical functional (vd yes/no)), and then a second one to gather all of them and the time-constant special terms for further processing (where.ttlf, where.lf etc.). ATM, tt(x) and a tt(s(x)) terms would be processed the same way before being sent on to the fitter, so that's probably not going to work. What we would want for the time-varying terms is to be replaced by tt-terms that coxph understands with the appropriate tt-function calling s.cox & friends … right? Alternatively, you could allow special terms tts(x) (for tt(s(x))) ttlf.vd(x) etc. in the formula. I think the first approach as given in pcox.tex is cleaner.

QUESTIONS