run_analyses: run_analyses

View source: R/optimize.R

run_analysesR Documentation

run_analyses

Description

This function performs a full analysis of an inputted dataframe. The user may specify one of two copulas, a theta value, a parametric grid to search over, and a vector of times for predicting survival.

Usage

run_analyses(
  DATA,
  THETAs = NULL,
  upKAPPA,
  gTHRES = 0.1,
  COPULAS,
  param_grid,
  vec_time,
  ncores = 1,
  max_iter = 200,
  verb,
  PLOT
)

Arguments

DATA

A data.frame containing column names time (in years), delta (event indicator), log_dens_t2 (log-transformed population-based density), and log_cdf_t2 (log-transformed population-based cumulative density).

THETAs

A vector of theta values to explore and optimize over.

upKAPPA

An integer value taking values 0 or 1. If set to 1, the exponentiated Weibull distribution is assumed. Otherwise, the Weibull distribution is assumed and optimized over. If undefined, the optimization will search over both distributions.

gTHRES

A numeric threshold on the L2 norm of the gradient evaluated at the MLE.

COPULAS

If undefined, will optimize over all copulas. Otherwise set to 'Independent', 'Clayton' or 'Gumbel'

param_grid

Vector of values spanning possible log(alpha1), log(lambda1), log(kappa1), unconstrained theta parameters

vec_time

Vector of times in years to calculate predicted survival.

ncores

A positive integer for the number of threads to evaluate log-likelihoods across the parameter grid.

max_iter

Maximum Newton Raphson and Gradient Descent iterations to set.

verb

Boolean value to display verbose information or not

PLOT

A logical variable, set to TRUE by default to show the two-dimensional heatmap of the profile likelihood if verb = TRUE.

Value

Returns a parsable list of results per successfully optimized configuration of copula and density with accompanying net survival predictions, survival confidence intervals, maximum likelihood estimates, MLE confidence intervals (constrained and unconstrained), Bayesian Information Criteria for model selection, and extra statistical metrics to confirm convergence.


dMrs documentation built on April 3, 2025, 7:39 p.m.