% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/aftPenCDA.r
\name{aftpen}
\alias{aftpen}
\title{Penalized AFT estimation for right-censored data}
\usage{
aftpen(
  dt,
  lambda,
  se,
  type = c("BAR", "LASSO", "ALASSO", "SCAD"),
  r = 3.7,
  eps = 1e-08,
  max.iter = 100
)
}
\arguments{
\item{dt}{A data frame whose first two columns are \code{y} and \code{d},
where \code{y} is the observed survival or censoring time and \code{d}
is the event indicator (\code{1} for observed event and \code{0} for
right-censoring). The remaining columns are treated as covariates.}

\item{lambda}{A nonnegative tuning parameter controlling the amount of
penalization.}

\item{se}{A character string specifying the variance estimation method.
\describe{
\item{"CF"}{Closed-form (plug-in) variance estimator based on the analytic expression of the estimating function (see Equation (6)).}
\item{"ZL"}{Perturbation-based variance estimator using the resampling approach of Zeng and Lin (2008).}
}}

\item{type}{Penalty type. One of \code{"BAR"}, \code{"LASSO"},
\code{"ALASSO"}, or \code{"SCAD"}.}

\item{r}{A positive tuning constant used in the SCAD penalty. Ignored unless
\code{type = "SCAD"}. The default is \code{3.7}.}

\item{eps}{Convergence tolerance for the outer penalized coordinate descent
iterations. The default is \code{1e-8}.}

\item{max.iter}{Maximum number of iterations for the outer penalized
coordinate descent algorithm. The default is \code{100}.}
}
\value{
A list containing the following components:
\itemize{
\item \code{beta}: final coefficient estimate on the original scale.
}
}
\description{
Fits a penalized accelerated failure time (AFT) model for right-censored
survival data using induced smoothing and a penalized coordinate descent
algorithm. Supported penalties include BAR, LASSO, adaptive LASSO, and SCAD.
}
\details{
The function first calls the Rcpp backend \code{is_aft_cpp()} to obtain
an initial estimator together with gradient and Hessian information.
A Cholesky-based transformation is then applied, followed by coordinate-wise
penalized updates.

For \code{type = "BAR"}, the update uses the internal \code{BAR_threshold()} operator.
For \code{type = "LASSO"}, \code{"ALASSO"}, and \code{"SCAD"}, soft-thresholding-based updates are used.
}
\examples{
n = 100
p = 10
beta0 = c(rep(1,3),rep(0,7))
x = matrix(rnorm(n * p), n, p)
T = exp(x\%*\%beta0 + rnorm(n))
C = rexp(n, rate = exp(-2))
d = 1*(T<C)
y = pmin(T,C)
dt = data.frame(y,d,x)
fit <- aftpen(dt, lambda = 0.1, se = "CF", type = "BAR")
fit$beta
}
