estimate_parameters_PHM {cmpp}R Documentation

Estimate Parameters for the Proportional Hazards Model (PHM)

Description

This function estimates the parameters of the Proportional Hazards Model (PHM) using maximum likelihood estimation. It computes the Hessian matrix, calculates standard errors, and derives p-values for the estimated parameters. The function ensures that the diagonal elements of the covariance matrix are positive for valid variance estimates.

Usage

estimate_parameters_PHM(initial_params, FeaturesNames = NULL)

Arguments

initial_params

A numeric vector of initial parameter values to start the optimization. Default is rep(0.001, 2 * (2 + ncol(features))), where features is the matrix of predictor variables.

FeaturesNames

A character vector specifying the names of the features (covariates). If NULL, default names (beta1, beta2, etc.) will be generated.

Details

This function performs the following steps:

The Proportional Hazards Model (PHM) is a parametric model for cumulative incidence functions in competing risks analysis. It uses Gompertz distributions to model the failure times for competing events.

Value

A data frame containing:

Parameter

The parameter names, including tau1, rho1, tau2, rho2, and covariate coefficients (beta1, beta2, etc.).

Estimate

The estimated parameter values.

S.E

The standard errors of the estimated parameters.

PValue

The p-values for the estimated parameters.

See Also

stats::optim, compute_log_f_gradient_rcpp3, log_f_rcpp3.

Examples

library(cmpp)
set.seed(1984)
# Example data
features <- matrix(rnorm(300, 1, 2), nrow = 100, ncol = 3)
delta1 <- sample(c(0, 1), 100, replace = TRUE)
delta2 <- 1 - delta1
x <- rexp(100, rate = 1/10)

# Initialize the Cmpp model
Initialize(features, x, delta1, delta2, h = 1e-5)

# Define initial parameter values
initial_params <- rep(0.001, 2 * (ncol(features) + 2))

# Estimate parameters using the PHM
result <- estimate_parameters_PHM(initial_params)
print(result)


[Package cmpp version 0.0.2 Index]