Displaying 1 result from an estimated 1 matches for "lnerlb".
Did you mean:
leerlo
2001 Sep 06
0
Erlang Loss Function in R
...d.) Here is the code:
erlb<- function(nsrv, nerl, log=FALSE)
{
# Returns Erlang-B blockage for nsrv servers and nerl erlangs of traffic.
# If log=TRUE, then logarithm of the blockage is returned. Works for all
# nsrv>=0 and all nerl>=0. Both nsrv and nerl can be non-integers.
lnerlb<-
dgamma(nerl, shape=nsrv+1, scale=1, log=TRUE) -
pgamma(nerl, shape=nsrv+1, scale=1, log.p=TRUE, lower.tail=FALSE) ;
if (log) lnerlb else exp(lnerlb)
}
This version has these advantages
. MUCH faster, especially for large values of the 1st argument
. Works for non-integral 'nsr...