Learn R Programming

RCASPAR (version 1.18.0)

weights_BLH: Optimization for the regression coefficients and baseline hazards that maximize the partial likelihood in our PW Cox PH regression model.

Description

This function is a wrapper around the optimization function optim to allow the optimization for the regression coefficients and baseline hazards appropriate for the data set at hand. It is where the functions weight_estimator_BLH, weight_estimator_BLH_noprior, deriv_weight_estimator_BLH, deriv_weight_estimator_BLH_noprior are required.

Usage

weights_BLH(geDataT, survDataT, q, s, a, b, groups, par, method = c("Nelder-Mead", "L-BFGS-B", "CG", "BFGS", "SANN"), noprior = 1, extras = list(),
dist = NULL)

Arguments

geDataT
A matrix with the co-variate in the columns and the subjects in the rows.Each cell corresponds to that rowth subject's columnth co-variate's value.
survDataT
A data frame with the survival data of the set of subjects at hand. It should at least have the following columns True_STs and censored, corresponding to the observed survival times and the censoring status of the subjects consecutively. Censored patients are assigned a 1 while patients who experience an event are assigned 1.
q
One of the two parameters on the prior distribution used on the weights (regression coefficients) in the model.
s
The second of the two parameters on the prior distribution used on the weights (regression coefficients) in the model.
a
The shape parameter for the gamma distribution used as a prior on the baseline hazards.
b
The scale parameter for the gamma distribution used as a prior on the baseline hazards.
groups
The number of partitions along the time axis for which a different baseline hazard is to be assigned. This number should be the same as the number of initial values passed for the baseline hazards in the beginning of the weights_baselineH argument.
par
A single vector with the initial values of the baseline hazards followed by the weights(regression coefficients) for the co-variates.
method
The preferred optimization method. It can be one of the following: "Nelder-Mead": for the Nelder-Mead simplex algorithm. "L-BFGS-B": for the L-BFGS-B quasi-Newtonian method. "BFGS": for the BFGS quasi-Newtonian method. "CG": for the Conjugate Gradient decent method "SANN": for the simulated annealing algorithm.
noprior
An integer indicating the number of iterations to be done without assuming a prior on the regression coefficients.
extras
The extra arguments to passed to the optimization function optim. For further details on them, see the documentation for the optim function.
dist
The distribution function to be passed to the optimization algorithm in case of using SANN to generate a new candidate point.

Value

  • The same value as the optim function. See it's documentation for details.

References

http://sekhon.berkeley.edu/stats/html/optim.html

Examples

Run this code
data(Bergamaschi)
data(survData)
weights_BLH(geDataT=Bergamaschi[1:10,1:2], survDataT=survData[1:10, 9:10], q=1, s=1, a=1.56, b=0.17, groups=3, par=c(0.1,0.2,0.3,rep(0,ncol(Bergamaschi))), method = "CG", noprior = 1, extras =
list(reltol=1), dist = NULL)

Run the code above in your browser using DataLab