orthoDr_surv: Counting Process based semiparametric dimension reduction...

View source: R/orthoDr_surv.r

orthoDr_survR Documentation

Counting Process based semiparametric dimension reduction (IR-CP) model

Description

Models the data according to the counting process based semiparametric dimension reduction (IR-CP) model for right censored survival outcome.

Usage

orthoDr_surv(
  x,
  y,
  censor,
  method = "dm",
  ndr = ifelse(method == "forward", 1, 2),
  B.initial = NULL,
  bw = NULL,
  keep.data = FALSE,
  control = list(),
  maxitr = 500,
  verbose = FALSE,
  ncore = 0
)

Arguments

x

A matrix or data.frame for features. The algorithm will not scale the columns to unit variance

y

A vector of observed time

censor

A vector of censoring indicator

method

Estimation equation to use. Either: "forward" (1-d model), "dn" (counting process), or "dm" (martingale).

ndr

The number of directions

B.initial

Initial B values. Will use the counting process based SIR model CP_SIR as the initial if leaving as NULL. If specified, must be a matrix with ncol(x) rows and ndr columns. Will be processed by Gram-Schmidt if not orthogonal.

bw

A Kernel bandwidth, assuming each variables have unit variance.

keep.data

Should the original data be kept for prediction. Default is FALSE

control

A list of tuning variables for optimization. epsilon is the size for numerically approximating the gradient. For others, see Wen and Yin (2013).

maxitr

Maximum number of iterations

verbose

Should information be displayed

ncore

Number of cores for parallel computing. The default is the maximum number of threads.

Value

A orthoDr object consisting of list with named elements:

B

The optimal B value

fn

The final functional value

itr

The number of iterations

converge

convergence code

References

Sun, Q., Zhu, R., Wang, T., & Zeng, D. (2019). Counting process-based dimension reduction methods for censored outcomes. Biometrika, 106(1), 181-196. DOI: \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1093/biomet/asy064")}

Examples

# This is setting 1 in Sun et. al. (2017) with reduced sample size
library(MASS)
set.seed(1)
N <- 200
P <- 6
V <- 0.5^abs(outer(1:P, 1:P, "-"))
dataX <- as.matrix(mvrnorm(N, mu = rep(0, P), Sigma = V))
failEDR <- as.matrix(c(1, 0.5, 0, 0, 0, rep(0, P - 5)))
censorEDR <- as.matrix(c(0, 0, 0, 1, 1, rep(0, P - 5)))
T <- rexp(N, exp(dataX %*% failEDR))
C <- rexp(N, exp(dataX %*% censorEDR - 1))
ndr <- 1
Y <- pmin(T, C)
Censor <- (T < C)

# fit the model
forward.fit <- orthoDr_surv(dataX, Y, Censor, method = "forward")
distance(failEDR, forward.fit$B, "dist")

dn.fit <- orthoDr_surv(dataX, Y, Censor, method = "dn", ndr = ndr)
distance(failEDR, dn.fit$B, "dist")

dm.fit <- orthoDr_surv(dataX, Y, Censor, method = "dm", ndr = ndr)
distance(failEDR, dm.fit$B, "dist")

orthoDr documentation built on April 30, 2023, 5:12 p.m.