Click here to load reader
Upload
srmanohara
View
226
Download
0
Embed Size (px)
Citation preview
Evaluation of the Erlang-B formula
Ondřej HudousekDepartment of Telecommunication engineering
Czech Technical University in Prague, Faculty of Electrical EngineeringTechnická 2
166 27 Praha 6 - DejviceE-mail: [email protected]
Abstract
This article sums up the methods of evaluation of
the Erlang-B formula. In addition to known appro-
aches, some improvements of the evaluation leading
to its acceleration are introduced.
1 Introduction
Erlang-B is probably the most important formulaused for dimensioning of the loss systems classifiedM/M/N/0 according to Kendall’s classification. Itsaim is to determine the probability of loss basedon the offered traffic and the number of circuits. Itis often necessary to evaluate it with a prescribedaccuracy. As it is used repeatedly in some appli-cations, the speed of the evaluation might be signi-ficant.
The basic form of the Erlang-B formula for aninteger number of circuits is:
E1,N (A) = BN =AN
N !∑N
i=0Ai
i!
, (1)
where B is loss probability,A offered traffic,N number of circuits.
A generalized version of the formula is available fora non-integer number of circuits:
E1,x(A) =Axe−A
∫
∞
Atxe−tdt
. (2)
2 Evaluation of E1,N(A) for in-teger number of circuits
Direct evaluation of E1,N (A) according to thedefinition would be time consuming. Therefore, arecurrent form of the formula is used widely:
E1,N+1(A) = BN+1 =A ·BN
N + 1 +A ·BN
, B0 = 1.
(3)
Concerning a real implementation it is better toevaluate the reciprocal value of E1,N (A):
IN (A) =1
E1,N (A)= 1 +
N
AIN−1, I0 = 1. (4)
Due to constant offered traffic A during the eva-luation it is possible to multiply by the recipro-cal value 1/A instead of dividing by the value A.This accelerates the evaluation considerably as it isshown in the table1. It is also possible to substitutethe incrementation of a temporary variable with1/A for multiplication N(1/A), which also resultsin faster evaluation.
n 30 60 90 120 480 1890td[µs] 2.1 4.1 6.2 8.2 32.6 128.2to[µs] 0.8 1.4 2.0 2.7 10.4 40.9
Table 1: Time of evaluation of the Erlang-B2
1Duration of the evaluation was measured using RDTSCinstruction (see [6]). Due to a wide variety of availableprocessors and other impacts,the character of the above-mentioned values is only informative. The measuring wasperformed on Intel Pentium III running at 800 MHz, usingMS Windows 2000 and time critical priority of the process.2td – time of evaluation for direct implementation of the
recurrent formula, to – optimized version, N stays for num-ber of circuits. Loss probability is B = 0.01.
Another approach to fastening the evaluation isvia the approximation according to [1]. It can beshown that:
I0 = 1, (5)
I1 = 1 +1
A, (6)
I2 = 1 +2
A
(
1 +1
A
)
= 1 +2
A+1 · 2
A2, (7)
· · ·
IN = 1 +N
A+
N(N − 1)
A2+ · · ·+
N !
AN(8)
= 1 +
N∑
i=1
1
Ai
N !
(N − i)!. (9)
It is not necessary for large A and N to count in allterms of the sum in the equation (9). The difficultyof this approach lies in finding out the appropri-ate number of terms to achieve a desired accuracy.It is possible to accelerate the algorithm partiallyeven by checking whether the value IN is not higherthan the predefined value 1/E1,N . This approach issuitable for very large values of the offered traffic.
3 Evaluation of E1,x(A) for
non-integer number of cir-
cuits
Instead of direct evaluation of E1,x(A) for x ∈ R,x ≥ 0 various approximations are often used. Themost popular is probably the following one.
3.1 Rapp’s approximation
Y.Rapp published in [3] approximation based onthe equality of E1,x(A) and its first derivative withthe approximating function and its first derivativein the points x = 0 and x = 1:
E1,x(A) ≈ C0 + C1x+ C2x2, (10)
C0 = 1, (11)
C1 = −A+ 2
(1 +A)2 +A, (12)
C2 =1
(1 +A)[(1 +A)2 + A]. (13)
The approximating function is directly used in theinterval x ∈ 〈0..1〉. For x > 1 a fractional part ofthe loss probability is determined. The final valueof the approximation is evaluated using equation(3) which is also valid for N ∈ R.
3.2 Szybicky’s approximation
Another approximation was developed by Ed-mund Szybicky [4]. It is intended to be used on in-terval x ∈ 〈0..2〉 and it equals to E1,x(A) in pointsx = 0, 1, 2.
E1,x(A) ≈(2− x) ·A+A2
x+ 2A+A2. (14)
For x > 2 it is again possible to use the approxi-mation in conjunction with the recurrent formula(3).
3.3 Expansion of incomplete gamma
function into continued fraction
G.Lévy-Soussan suggested in [2] using expan-sion of incomplete gamma function into continuedfraction.
3.3.1 Continued fraction
According to Lévy-Soussan the expansion intocontinued fraction is function f(x0, x1, . . . , xn) inthe following form:
f(x0, x1, . . .) = b0 +a1
b1 +a2
b2 +a3
. . .
, (15)
which is sometimes written as
f(x0, x1, . . .) = b0+a1b1+
a2b2+ . . .+
an
bn+ . . . ,
(16)where ai and bi are functions of the real or com-plex variable xi. Limited expansion into the conti-nued fraction with n terms is function
fn(x0, x1, . . . , xp) = b0 +a1b1+
a2b2+ . . .+
an
bn.
(17)It is possible to evaluate fn directly from the end ofthe continued fraction. Unfortunately, this method
is suitable only when the number of the expansionterms is already known. Otherwise a recurrent for-mula suggested by J.Wallis in 1655 could be used:
fn =pn
qn
, (18)
pn = bnpn−1 + anpn−2, (19)
qn = bnqn−1 + anqn−2,
p−1 = 1, p0 = b0, q−1 = 0, q0 = 1.
3.3.2 Expansion of incomplete gamma
function
Incomplete gamma function is defined by theequation
Γ(a, x) =
∫
∞
x
e−tta−1dt, (20)
where Re(a) > 0 and Re(x) > 0. It is possible toexpress E1,x(A) as
E1,x(A) =Axe−A
Γ(1 + x, A). (21)
Incomplete gamma function could be expanded intocontinued fraction:
Γ(1 + x, A) = (22)
= e−AAx( 11+−xA+11+1− x
A+21+ . . .
)
,
where
a2n = −x+ n− 1, b2n = A,
a2n+1 = n, b2n+1 = 1,
a1 = 1, b0 = 0.
Above mentioned expansion into continued fractionis converging for all A > 0 and x > 0 (both condi-tions are valid for the real systems). Nevertheless,the convergence for x > A is slow, and therefore, itis often time-consuming to obtain a result with anappropriate accuracy. In these cases, it is advisa-ble to evaluate E1,A−1+θ(A), where θ is fractionalpart of x. The final value of the loss probability isevaluated with the recurrent equation (3) or (4).To achieve a desired accuracy it is advisable toevaluate separately expansion for even and odd
number of terms of the expansion rather than directexpansion of Fn(A, x). According to Lévy-Soussane
E1,x(A) = limn→∞
∣
∣
∣
∣
1
Pn(A, x)∼
1
In(A, x)
∣
∣
∣
∣
. (23)
It is possible to derive
Pn(A, x) =A
A− x+
xA− x+ 2
+ (24)
+2(x− 1)
A− x+ 4+ · · ·+
(n− 1)(x− n+ 2)A− x+ 2n− 2
,
In(A, x) = 1 +x
A− x+ 1+
x− 1A− x+ 3
+ (25)
+2(x− 2)
A− x+ 5+ · · ·+
(n− 1)(x− n+ 1)A− x+ 2n− 1
.
3.3.3 Evaluation of In(A, x) and Pn(A, x)
In [2] Lévy-Sousanne is only concerned with theevaluation of continued fraction backwards fromthe term bn. He comments on the usage of theequation (19): „. . . stability is not guaranteed andthe result obtained is the ratio of two almost-equallarge numbers, which is not acceptable in numeri-cal analysisÿ. As it has been stated above, it is ne-cessary to repeat the evaluation from the n–th termfor increasing n until reaching the desired accuracy.Obviously, this is a rather tedious procedure whichcompensates the advantage of rapid convergence ofthe functions In a Pn. However, the algorithm (19)was improved into the form of the modified Lentz’smethod [5]. Instead of using pn and qn temporaryvariables un and vn are used
un =pn
pn−1
, vn =qn−1
qn
(26)
and the resulting function is
fn = fn−1unvn, (27)
where
f0 = b0, u0 = f0 = b0, v0 = 0. (28)
un =pn
pn−1
= bn + an
pn−2
pn−1
= bn +an
un−1
, (29)
vn =(
bn + an
an−2
an−1
)
−1
= (bn + anvn−1)−1. (30)
A problem may occur if the denominator in theevaluation of un or vn equals to zero. Thompsonand Barnett suggested a slight modification of thealgorithm to address this issue. If un−1 = 0 orbn+ anvn−1 = 0 during the evaluation, it is substi-tuted for a small constant, e.g. 10−30. Lentz’s algo-rithm could be symbolically written for the desiredaccuracy ε as follows:
1 tiny ← 10−30,2 f0 ← b0,3 if b0 = 0, then f0 ← tiny,4 u0 ← f0,5 v0 ← 0,6 ∆j ← ε,7 while |∆j − 1| < ε, do:8 vj ← bj + ajvj−1,9 if vj = 0, then vj ← tiny,10 uj ← bj + aj/uj−1,11 if uj = 0, then uj ← tiny,12 vj ← 1/vj ,13 ∆j ← ujvj ,14 fj ← fj−1∆j .
From the practical point of view, it is advisableto evaluate Pn(A, x) and In(A, x) simultaneously,as it is possible to exploit the similarity of the ex-pansion terms, (see (24),(25)) and thus acceleratethe algorithm.
3.4 Comparison of the evaluation
time
To discover the practical suitability of the algo-rithms, their speed has been examined. Table 2shows the results for both Rapp’s approximation(tr and tropt) and the expansion of incomplete ga-mma function into continued fraction (tc and tcopt,accuracy 1.10−5, B=0.01) both for direct and opti-mized implementation:
n 30 60 90 120 480 1890tr[µs] 4.6 8.8 13.0 17.2 67.9 266.3
tropt[µs] 0.6 0.9 1.2 1.5 5.2 19.5tc[µs] 5.4 7.0 7.9 8.5 12.4 16.3
tcopt[µs] 3.3 4.1 5.2 5.8 11.6 28.8Table 2: Comparison of the times spent on
evaluation of the Erlang-B formula using variousimplementations.
4 Conclusion
The aim of this article is to sum up the me-thods of evaluation of the Erlang-B formula. In ad-dition to known approaches, usage of Lentz’s algori-thm for evaluation of the expansion into continuedfraction was suggested. The usage of the expansionof incomplete-gamma function brings, in contrastto the Rapp approximation, feasibility to meet thepredefined accuracy. This advantage is compensa-ted by higher complexity of the algorithm, whichresults in slower evaluation for small numbers ofcircuits, as it was proved by testing on real imple-mentations. On the testing system , the optimizedversion of Rapp’s approximation was faster thanevaluation of the expansion of incomplete gammafunction up to approx. 1500 circuits (B=0.01). The-refore, Rapp’s approximation is probably the mostsuitable for common cases, as far as the evaluationtime. Apart from that, some improvements leadingto fastening the evaluation of the recurrent formula(3) have been suggested.
Reference
[1] ITC; ITU-D SG2. Teletraffic en-
gineering handbook. Available at<http://www.tele.dtu.dk/teletraffic>.
[2] Lévy-Soussan, Guy. Numerical Evaluation ofthe Erlang Function through a Continued-Fraction Algorithm. Electrical Communi-cation, 1968, vol.43, no.2, p.163–168.
[3] Rapp, Yngve. Planning of Junction Network ina Multi–exchange Area. II Extensions of thePrinciples and Applications. Ericsson Tech-nics, 1965, no.2, p.187–240.
[4] Szybicky, Edmund.Some Numerical MethodsUsed for Telephone Traffic Theory Applicati-ons. Ericsson Technics, 1964, no.2, p.203-229.
[5] Numerical Recipes in C: The Art of ScientificComputing, Cambridge University Press, 1992.Available at <http://www.nr.com>.
[6] Using the RDTSC Instrucion for Per-
formance Monitoring, Intel Corporation,1997. Available at <http://cedar.intel.com/software/idap/media/pdf/rdtscpm1.pdf>.