Iteratively solves likelihood of truncated normal with censoring using only gradient and/or likelihood values
tcensReg_optim(
y,
X,
a = -Inf,
v = NULL,
method,
epsilon = 1e-04,
tol_val = 1e-06,
max_iter = 100,
step_max = 10,
theta_init = NULL
)
Numeric vector with the observed truncated and censored outcomes
Numeric design matrix
Numeric scalar indicating the truncation value. Initial value is -Inf indicating no truncation
Numeric scalar indicating the censoring value. Initially set to NULL indicating no censoring
Character value indicating which optimization routine to perform.
Choices include Newton
, BFGS
, and CG
. See details for explanation on each method.
Numeric value used to define when the algorithm should stop when the gradient is less then epsilon. Default is 0.001
Tolerance value used to stop the algorithm if the (n+1) and (n) log likelihood is within the tolerance limit
Maximum number of iterations for algorithm. Default is 100
Maximum number of steps when performing line search. Default is 10
Initial values of theta provided by the user. If unspecified then calculates values from OLS regression
Returns a list of final estimate of theta, total number of iterations performed, initial log-likelihood, final log-likelihood, and estimated variance covariance matrix.