Package {lillardhaz}


Type: Package
Title: Simultaneous-Equations Hazard/Probit Models with a Gaussian-Copula Correlation
Version: 1.0.0
Date: 2026-09-25
Description: Fits two-equation simultaneous models in the style of Lillard (1993) <doi:10.1016/0304-4076(93)90106-F>: a pair of processes, each either a binary probit outcome or a continuous-time hazard duration, linked through a single correlation parameter between their underlying error terms and estimated jointly by maximum likelihood via a Gaussian copula. Equation 1 may be a probit, a log-normal accelerated-failure-time hazard, or a piecewise (linear-log-hazard) Gompertz hazard with an arbitrary, user-specified number of segments; equation 2 is always a hazard, log-normal or piecewise Gompertz. Models can also be fit under independence (correlation fixed at zero), which reduces exactly to two separate univariate fits. See the package vignette/manual for the full likelihood derivation and a simulation-based verification.
License: MIT + file LICENSE
Encoding: UTF-8
Depends: R (≥ 3.5)
Imports: maxLik, pbivnorm, stats
Suggests: testthat (≥ 3.0.0)
Config/testthat/edition: 3
URL: https://github.com/nobifukuda/lillardhaz
BugReports: https://github.com/nobifukuda/lillardhaz/issues
Config/roxygen2/version: 8.0.0
NeedsCompilation: no
Packaged: 2026-10-06 09:08:06 UTC; nfukuda
Author: Nobutaka Fukuda [aut, cre]
Maintainer: Nobutaka Fukuda <nobutaka.fukuda@tohoku.ac.jp>
Repository: CRAN
Date/Publication: 2026-10-16 09:20:13 UTC

lillardhaz: Simultaneous-Equations Hazard/Probit Models

Description

Fits two-equation simultaneous models in the style of Lillard (1993): a pair of processes – each a binary probit outcome or a continuous-time hazard duration – linked through a single correlation parameter between their underlying error terms, estimated jointly by maximum likelihood via a Gaussian copula. See fit_lillardhaz.

Author(s)

Maintainer: Nobutaka Fukuda nobutaka.fukuda@tohoku.ac.jp

Authors:

See Also

Useful links:


Fit a Lillard-style simultaneous-equations hazard/probit model

Description

Fits a two-equation simultaneous model in the style of Lillard (1993): a pair of processes, each either a binary probit outcome or a continuous- time hazard duration, linked through a single correlation parameter between their underlying error terms and estimated jointly by maximum likelihood via a Gaussian copula.

Usage

fit_lillardhaz(
  eq1,
  eq2,
  data,
  y1,
  d1 = NULL,
  y2,
  d2,
  x1 = character(0),
  x2 = character(0),
  nodes1 = NULL,
  nodes2 = NULL,
  corr = TRUE,
  start = NULL,
  method = "BFGS"
)

Arguments

eq1

one of "probit", "lognormal", "pgompertz".

eq2

one of "lognormal", "pgompertz".

data

a data frame.

y1

name of equation 1's outcome: the binary 0/1 variable if eq1="probit", otherwise the duration variable.

d1

name of equation 1's failure indicator (ignored if eq1="probit").

y2

name of equation 2's duration variable.

d2

name of equation 2's failure indicator.

x1

character vector of covariate names for equation 1's location index (may be empty for an intercept-only equation).

x2

character vector of covariate names for equation 2's location index.

nodes1, nodes2

interior nodes (ascending numeric vectors) for a piecewise-Gompertz equation 1/equation 2; required exactly when that equation is "pgompertz".

corr

logical; if FALSE, fixes the copula correlation at 0 and fits the two equations independently (see the manual for why this reduces exactly to two separate univariate fits).

start

optional named numeric vector of starting values.

method

optimization method passed to maxLik::maxLik.

Value

An object of class "lillardhaz": a list with components

coefficients

named numeric vector of maximum-likelihood estimates (equation 1 and 2 location coefficients, ancillary parameters such as ln_sigma or piecewise-Gompertz slopes, and atanh_rho if corr = TRUE).

se

standard errors from the inverse negative Hessian (NA if the Hessian is singular).

loglik

maximized log-likelihood.

rho, rho_se

estimated copula correlation between the two equations' error terms and its delta-method standard error (0 and NA when corr = FALSE).

fit

the underlying maxLik object.

eq1type, eq2type, nodes1, nodes2, corr, x1, x2, y1name, y2name

the model specification.

n

number of observations.

call

the matched call.

Methods for print, summary and predict are available.

Examples

set.seed(1)
n <- 2000
x1 <- rnorm(n); x2 <- rbinom(n, 1, 0.5)
t1 <- exp(1 - 0.3 * x1 + 0.5 * rnorm(n))
c1 <- -log(runif(n)) / 0.05
t2 <- exp(0.6 + 0.4 * x2 + 0.6 * rnorm(n))
c2 <- -log(runif(n)) / 0.05
d <- data.frame(
  time1 = pmin(t1, c1), event1 = as.integer(t1 <= c1),
  time2 = pmin(t2, c2), event2 = as.integer(t2 <= c2),
  x1 = x1, x2 = x2
)
fit <- fit_lillardhaz("lognormal", "lognormal", d,
                       y1 = "time1", d1 = "event1", y2 = "time2", d2 = "event2",
                       x1 = "x1", x2 = "x2")
summary(fit)
head(predict(fit, type = "surv2"))

Predicted survival/density/index from a fitted lillardhaz model

Description

Predicted survival/density/index from a fitted lillardhaz model

Usage

## S3 method for class 'lillardhaz'
predict(object, newdata, type = "surv2", ...)

Arguments

object

a fitted "lillardhaz" object.

newdata

optional data frame; defaults to the estimation sample via object$call.

type

one of "surv2" (default), "surv1", "dens1", "dens2", "pr1", "xb1", "xb2".

...

unused.

Value

A numeric vector with one element per row of newdata, evaluated at the estimated coefficients. Its meaning depends on type:

"xb1", "xb2"

the linear location index x'\beta of equation 1 or 2 (for a log-normal equation, the mean of log duration; for a piecewise-Gompertz equation, the log of the proportional hazard shift).

"pr1"

the predicted probability that the binary outcome of equation 1 equals 1, \Phi(x'\beta); only available when eq1 = "probit".

"surv1", "surv2"

the marginal survival probability S(t), a value in [0, 1], of equation 1 or 2 evaluated at the observed duration in newdata (variable y1 or y2 used in the fit).

"dens1", "dens2"

the marginal density f(t) of equation 1 or 2 evaluated at that duration.

The survival and density predictions are marginal (per equation) and do not condition on the other equation's outcome.