Iteratively solve the optimization log likelihood problem using Newton-Raphson algorithm with analytic gradient and Hessian values and step halving.
tcensReg_newton(
y,
X,
a = -Inf,
v = NULL,
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
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.