This function is used to find estimates from a linear equation assuming that the data is observed from a truncated
distribution with left censoring. It uses numerical values of the gradient vector and hessian matrix to
solve for the maximum likelihood using maxLik
package. This function can also
be used with censored only, truncated only, or uncensored and untruncated gaussian models.
tcensReg_sepvar(
formula,
a = -Inf,
v = NULL,
group_var,
method = c("BFGS", "maxLik", "CG"),
theta_init = NULL,
data = sys.frame(sys.parent()),
max_iter = 100,
...
)
Object of class formula
which symbolically describes the model to be fit
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 scalar indicating a variable in the data.frame that defines the independent groups
Character value indicating which optimization routine to perform.
Choices include BFGS
, maxLik
and CG
.
See details for explanation on each method.
Optional initial values for the parameters. Default is to fit a linear regression model.
Data.frame that contains the outcome and corresponding covariates. If none is provided then assumes objects are in user's environment.
Numeric value indicating the maximum number of iterations to perform.
Additional arguments such as max_iter
, step_max
, or epsilon
.
Returns a list of final estimate of theta, total number of iterations performed, initial log-likelihood, final log-likelihood, and estimated variance covariance matrix.
Currently available optimization routines include conjugate gradient (CG
),
Newton-Raphson type via maxLik package (maxLik
), and BFGS (BFGS
).
The default method is set as the conjugate gradient.
Both the of the conjugate gradient and BFGS methods are implemented via the
general-purpose optimization optim
. These two methods use only
the respective likelihood and gradient functions.
The Newton-Raphson method uses the likelihood, gradient, and Hessian
functions along with line search to achieve the maximum likelihood.