estimate_parameters_GOR | R Documentation |
This function estimates the parameters of the Generalized odds rate (GOR) 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.
estimate_parameters_GOR(initial_params, FeaturesNames = NULL)
initial_params |
A numeric vector of initial parameter values to start the optimization.
Default is |
FeaturesNames |
A character vector specifying the names of the features (covariates).
If |
This function performs the following steps:
Estimates the model parameters using the optim
function with the BFGS method.
Computes the gradient of the log-likelihood using the compute_log_f_gradient_rcpp
function.
Computes the Hessian matrix numerically using the hessian
function from the numDeriv
package.
Ensures that the diagonal elements of the covariance matrix are positive to avoid invalid variance estimates.
Calculates standard errors and p-values for the estimated parameters.
The Generalized odds rate (GOR) is a parametric model for cumulative incidence functions in competing risks analysis. It uses Gompertz distributions to model the failure times for competing events.
A data frame containing:
Parameter |
The parameter names, including |
Estimate |
The estimated parameter values. |
S.E |
The standard errors of the estimated parameters. |
PValue |
The p-values for the estimated parameters. |
stats::optim, compute_log_f_gradient_rcpp, log_f_rcpp, compute_log_f_hessian_rcpp.
library(cmpp)
# Example data
set.seed(371)
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/4)
# Initialize the Cmpp model
Initialize(features, x, delta1, delta2, h = 1e-5)
# Define initial parameter values
initial_params <- rep(0.001, 2 * (ncol(features) + 3))
# Estimate parameters using the GOR
result <- estimate_parameters_GOR(initial_params)
print(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.