
Last chance! 50% off unlimited learning
Sale ends in
erlang(shape.arg, link = "loge", earg=list(), imethod = 1)
Links
for more choices.earg
in Links
for general information.1
or 2
which
specifies the initialization method. If failure to converge occurs
try the other value."vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
and vgam
.shape.arg=1
then it simplifies to the exponential distribution. As illustrated
in the example below, the Erlang distribution is the distribution of
the sum of shape.arg
independent and identically distributed
exponential random variates. The probability density function of the Erlang
distribution is given by
gamma
.
The mean of Y
is $\mu=shape \times scale$ and
its variance is $shape \times scale^2$.
The linear/additive predictor, by default, is
$\eta=\log(scale)$.
Evans, M., Hastings, N. and Peacock, B. (2000) Statistical Distributions, New York: Wiley-Interscience, Third edition.
gamma2.ab
,
exponential
.rate = exp(2); myshape = 3
edata = data.frame(y = rep(0, nn <- 1000))
for(ii in 1:myshape)
edata = transform(edata, y = y + rexp(nn, rate = rate))
fit = vglm(y ~ 1, erlang(shape = myshape), edata, trace = TRUE)
coef(fit, matrix = TRUE)
Coef(fit) # Answer = 1/rate
1/rate
summary(fit)
Run the code above in your browser using DataLab