tcensReg_newton: Newton-Raphson Algorithm for Truncated Normal Distribution...

Description Usage Arguments Value

View source: R/tcensReg_newton.R

Description

Iteratively solve the optimization log likelihood problem using Newton-Raphson algorithm with analytic gradient and Hessian values and step halving.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
tcensReg_newton(
  y,
  X,
  a = -Inf,
  v = NULL,
  epsilon = 1e-04,
  tol_val = 1e-06,
  max_iter = 100,
  step_max = 10,
  theta_init = NULL
)

Arguments

y

Numeric vector with the observed truncated and censored outcomes

X

Numeric design matrix

a

Numeric scalar indicating the truncation value. Initial value is -Inf indicating no truncation

v

Numeric scalar indicating the censoring value. Initially set to NULL indicating no censoring

epsilon

Numeric value used to define when the algorithm should stop when the gradient is less then epsilon. Default is 0.001

tol_val

Tolerance value used to stop the algorithm if the (n+1) and (n) log likelihood is within the tolerance limit

max_iter

Maximum number of iterations for algorithm. Default is 100

step_max

Maximum number of steps when performing line search. Default is 10

theta_init

Initial values of theta provided by the user. If unspecified then calculates values from OLS regression

Value

Returns a list of final estimate of theta, total number of iterations performed, initial log-likelihood, final log-likelihood, and estimated variance covariance matrix.


tcensReg documentation built on July 8, 2020, 7:17 p.m.