View source: R/model_herlang.R
herlang | R Documentation |
Create an instance of Hyper-Erlang distribution
herlang( size, shape, mixrate = rep(1/length(shape), length(shape)), rate = rep(1, length(shape)) )
size |
An integer of the number of phases |
shape |
A vector of shape parameters |
mixrate |
A vector of initial probability (mixrate) |
rate |
A vector of rate parameters |
An instance of HErlang
If shape is given, shape is used even though size is set.
## create a hyper Erlang consisting of two Erlang ## with shape parameters 2 and 3. (param1 <- herlang(shape=c(2,3))) ## create a hyper Erlang with specific parameters (param2 <- herlang(shape=c(2,3), mixrate=c(0.3,0.7), rate=c(1.0,10.0))) ## convert to a general PH as.gph(param2) ## p.d.f. for 0, 0.1, ..., 1 (dphase(x=seq(0, 1, 0.1), ph=param2)) ## c.d.f. for 0, 0.1, ..., 1 (pphase(q=seq(0, 1, 0.1), ph=param2)) ## generate 10 samples (rphase(n=10, ph=param2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.