View source: R/curve_constructors.R
PieceExponential | R Documentation |
This creates a Curve object for a Piecewise Exponential distribution.
Curve objects contain all necessary information to describe a distribution, including functions and parameters describing it.
Parameterisation follows that used by pexp etc. This function requires a vector of start times (beginning with 0) and a corresponding vector of rates. See Details for more information on parameterisation.
PieceExponential(start, lambda)
start |
Vector of start times for each period. First element must be 0. Must be same length as lambda vector. |
lambda |
Vector of rate parameters from the corresponding respective time defined in start vector until the start of the next period. Must be same length as start vector. |
The piecewise exponential distribution with rates lambda_1 to lambda_n and start times t_1 to t_n has parameterisation:
Product(x=1:length(lambda)) of (e^(-lambda[x].t[x])) where t[x] = min(start[x+1],max(0,t-start[x])). start[x+1] is defined as Inf if otherwise undefined.
James Bell
PieceExponential(start=c(0,6,24),lambda=c(0.05,0.01,0.001))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.