pw_root: The Function for which the Root is Sought.
Description
The function pw_root() specifies the mathematical function g(t).
The equation to be solved is g(t)=0, with g(t) the cumulative hazard function of the piecewise exponential distribution +
log(u) with u a random draw from standard uniform distribution (see vignette "Piecewise_exponential", Section 2.2.4).
Usage
pw_root(t, breakpoints, rates, uu)
Value
Vector of differences between cumulative hazard and -log(uu) for
different values of t.
Arguments
t
Vector of durations for which the equation g(t)=0 should be solved.
breakpoints
Breakpoints
rates
Piecewise-constant rates
uu
Random draw from standard uniform distribution.
Details
pw_root is an argument of the function uniroot() of base R (argument "f"). It is required by uniroot().
The function uniroot() is called by
r.pw_exp(). See also Functions H_pw() and r.pw_exp().