rld
that do the actual computation.
rld.fit(X, C, delta, initial, lower, upper, frailty)
optim
is used to maximize the log-likelihood function. Method "L-BFGS-B" is that of Byrd et. al (1995) which allows box constraints, that is each variable can be given a lower and/or upper bound.
Byrd, R.H., Lu, P. Nocedal, J. and Zhu, C. (1995). A limited memory algorithm for bound constrained optimization. SIAMJ. Scientific Computing, 16, 1190-1208.
rld
, optim
data(SampleData)
newdata <- transdata(data = SampleData, ndlevel = 3, nexposure = c(10, 10, 2))
formulaexp <- survival::Surv(time, delta)~factor(dose)+trt+I(I(dose==3)*trt)
designmat <- model.matrix(formulaexp, data = newdata)
time <- SampleData$time
status <- SampleData$delta
inival <- rep(0.5, 6)
lwrval <- c(rep(-Inf, 5), 0.01)
uprval <- rep(Inf, 6)
frailty <- TRUE
rld.fit(X = designmat, C = time, delta = status, initial = inival,
lower = lwrval, upper = uprval, frailty = frailty)
Run the code above in your browser using DataLab