Description Usage Arguments Details Value Specification Examples
ppwe
computes the cumulative distribution function (CDF) or survival rate
for a piecewise exponential distribution.
1 2 3 4 5 |
x |
times at which distribution is to be computed. |
failRates |
Piecewise constant failure rates in |
lower.tail |
Indicator of whether lower (TRUE) or upper tail (FALSE; default) of CDF is to be computed. |
Suppose λ_i is the failure rate in the interval (t_{i-1},t_i], i=1,2,…,M where 0=t_0<t_i…,t_M=∞. The cumulative hazard function at an arbitrary time t>0 is then:
Λ(t)=∑_{i=1}^M δ(t≤ t_i)(\min(t,t_i)-t_{i-1})λ_i.
The survival at time t is then
S(t)=\exp(-Λ(t)).
A vector with cumulative distribution function or survival values
The contents of this section are shown in PDF user manual only.
1 2 3 4 5 6 7 8 9 10 11 | # Example: default
ppwe(seq(0:10))
# Example: plot a survival function with 2 different sets of time values
# to demonstrate plot precision corresponding to input parameters.
fr <- tibble::tibble(duration=c(3,3,1),rate=c(.2,.1,.005))
Time <- seq(0,10,10/pi)
Survival <- ppwe(Time,fr)
plot(Time,Survival,type="l",ylim=c(0,1))
Time <- seq(0,10,.25)
Survival <- ppwe(Time,fr)
lines(Time,Survival,col=2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.