nhejazi / haldensify

:package: R/haldensify: Highly Adaptive Lasso Conditional Density Estimation
https://codex.nimahejazi.org/haldensify
Other
17 stars 5 forks source link

Cox regression for hazard #9

Closed nhejazi closed 1 month ago

nhejazi commented 5 years ago

The glmnet package offers an option of using a penalized version of Cox's proportional hazards model for estimating a conditional hazard function. As the conditional hazard can be re-mapped to a conditional density, and the hal9001 function fit_hal may be used as a wrapper for glmnet, a HAL-based Cox regression for the conditional hazard may be performed. The estimates derived from such a regression procedure could be combined with Nelson-Aalen estimates of the baseline hazard to construct a conditional density estimate.

nhejazi commented 5 years ago

8 is intended to implement this procedure

nhejazi commented 3 years ago

Unfortunately, glmnet implements a limited version of Cox PH regression that is incapable of accommodating time-varying covariates, which appear in the formulation of the penalized Cox model fit on the HAL basis. However, this recent paper describes a new package pcoxtime providing exactly this functionality.

nhejazi commented 3 years ago

As of v4.1+, the glmnet package now provides support for handling time-dependent covariates in the regularized Cox model, see Section "Cox models for start-stop data" of https://cran.r-project.org/web/packages/glmnet/vignettes/Coxnet.pdf for details. This should be useful to allow implementation of the Cox-based conditional density without changing of the glmnet backend for HAL regression.