Learn R Programming

npsurv (version 0.3-3)

logLikuh: Computes the Log-likelihood Value of a U-shaped Hazard Function

Description

logLikuh returns the log-likelihood value of a U-shaped hazard function, given a data set.

Usage

logLikuh(h, data)

Arguments

h
an object of class uh.
data
numeric vector or matrix for exact or interval-censored observations, or an object of class icendata.

Value

  • Log-likelihood value evaluated at h, given data.

References

Wang, Y. and Fani, S. (2015). Nonparametric maximum likelihood computation of a U-shaped hazard function. (In preparation)

See Also

Uhaz, icendata, plot.uh

Examples

Run this code
data(ap)
(h0 = uh(.2, NULL, NULL, NULL, NULL, 15, 1))   # Uniform hazard
plot(h0, ylim=c(0,.3))
logLikuh(h0, ap)

r = Uhaz(ap, deg=2)
r$ll
logLikuh(r$h, ap)
plot(r$h, add=TRUE, col="red3")

Run the code above in your browser using DataLab