Description Usage Arguments Value Author(s) See Also Examples
This function calculates the hazard function at location t
based on input resulting from either find.shapeCPH or find.shapeMLE.
1 | find.hazard(t, h.val, h.ranges, type, mode)
|
t |
time at which to evaluate the hazard (must be univariate) |
h.val |
vector specifying changes of values in the hazard baseline MLE (output from e.g. |
h.ranges |
vector specifying locations of changes in values in the hazard baseline MLE (output from e.g. |
type |
type of shape constrained used (also given as output from e.g. |
mode |
location of mode or antimode (also given as output from e.g. |
A number giving the value of the estimated hazard at t.
Rihong Hui and Hanna Jankowski <hkj@mathstat.yorku.ca>
find.shapeCPH find.shapeMLE
1 2 3 4 5 6 7 8 9 10 11 12 | # random sample from the uniform density
n <- 100
x <- runif(n)
# compute MLE of increasing hazard and evaluate fitted hazard at t=0.2
mle <- find.shapeMLE(x, type="increasing")
find.hazard(0.2, mle$h.val, mle$h.range, type=mle$type)
# compute MLE of unimodal hazard and evaluate fitted hazard at t=0.2
mle <- find.shapeMLE(x, type="unimodal")
find.hazard(0.2, mle$h.val, mle$h.range, type=mle$type, mode=mle$mode)
|
[1] 1.177677
[1] 1.177677
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.