uh {npsurv} | R Documentation |
U-shaped Hazard Function
Description
Class uh
can be used to store U-shaped hazard functions.
There are a couple of functions associated with the class.
Usage
uh(alpha, tau, nu, eta, mu, upper=Inf, deg=1, collapse=TRUE)
## S3 method for class 'uh'
print(x, ...)
Arguments
alpha |
a nonnegative value, for the constant coefficient. |
tau |
vector of nonnegative real values, for left knots. |
nu |
vector of nonnegative values, for masses associated with the left knots. |
eta |
vector of nonnegative real values, for right knots. |
mu |
vector of nonnegative real values, for masses associated with the right knots. |
upper |
a positive value, at which point the hazard starts to become infinite. |
deg |
nonnegative real number for spline degree (i.e., p in the formula below). |
collapse |
logical, indicating if identical knots should be collapsed. |
x |
an object of class |
... |
other auguments for printing. |
Details
uh
creates an object of class uh
, which stores a U-shaped
hazard function.
print.uh
prints an object of class uh
.
A U-shape hazard function, as generalized by Wang and Fani (2018), is given by
h(t) = \alpha + \sum_{j = 1}^k \nu_j(\tau_j - t)_+^p + \sum_{j = 1}^{m} \mu_j (t-\eta_j)_+^p,
where \alpha,\nu_j,\mu_j \ge 0
,
\tau_1 < \cdots < \tau_k \le \eta_1 < \cdots < \eta_m,
and p \ge 0
is the the spline degree which
determines the smoothness of the U-shaped hazard. As p increases, the family
of hazard functions becomes increasingly smoother, but at the same time,
smaller. When p = 0
, the hazard function is U-shaped, as
studied by Bray et al. (1967). When p = 1
, the hazard function
is convex, as studied by Jankowski and Wellner (2009a,b).
print.uh
prints an object of class uh
. While alpha
,
upper
and deg
are printed as they are, tau
and
nu
are printed as a two-column matrix, and so are eta
and
mu
.
Value
uh
returns an object of class uh
. It is a list with components
alpha
, tau
, nu
, eta
, mu
, upper
and
deg
, which store their corresponding values as described above.
Author(s)
Yong Wang <yongwang@auckland.ac.nz>
References
Bray, T. A., Crawford, G. B., and Proschan, F. (1967). Maximum Likelihood Estimation of a U-shaped Failure Rate Function. Defense Technical Information Center.
Jankowski, H. K. and Wellner, J. A. (2009a). Computation of nonparametric convex hazard estimators via profile methods. Journal of Nonparametric Statistics, 21, 505-518.
Jankowski, H. K. and Wellner, J. A. (2009b). Nonparametric estimation of a convex bathtub-shaped hazard function. Bernoulli, 15, 1010-1035.
Wang, Y. and Fani, S. (2018). Nonparametric maximum likelihood computation of a U-shaped hazard function. Statistics and Computing, 28, 187-200.
See Also
Examples
(h0 = uh(3, 2, 3, 4, 5, 7, deg=0)) # deg = 0
plot(h0, ylim=c(0,20))
(h1 = uh(4, 2, 3, 5, 6, 7, deg=1)) # deg = 1
plot(h1, add=TRUE, col="green3")
(h2 = uh(1, 1:2, 3:4, 5:6, 7:8, 9, deg=2)) # deg = 2
plot(h2, add=TRUE, col="red3")