Estimation of arrival and service rates for M/M/c queue system Katarína Starinská starinskak@gmail.com Charles University Faculty of Mathematics and Physics Department of Probability and Mathematical Statistics Prague, Czech Republic 17.12.2012 Katarína Starinská (starinskak@gmail.com) Arrival and Service Rates 17.12.2012 1 / 22
Content 1 Notation 2 Estimation for queues from queue length data OU approximation for M/M/c queue Simulation results 3 MLE for single server queues from waiting time data The likelihood function based on the waiting times The consistency and the asymptotic normality of the MLE Application to M/M/1 Katarína Starinská (starinskak@gmail.com) Arrival and Service Rates 17.12.2012 2 / 22
Notation M/M/c The M/M/c queue system is a Markov process {X t, t 0} on the state space S = {0, 1,...} with non-zero transition rates q(m, m + 1) = λ, q(m, m 1) = µ min(m, c), where m S is the state of the process at time t. Poisson arrivals at rate λ independent exponentially distributed service times c servers each operating at rate µ c = 1 - estimating from waiting time data large c(> 40) - estimating from queue length data unknown parameters θ = (λ, µ) Katarína Starinská (starinskak@gmail.com) Arrival and Service Rates 17.12.2012 3 / 22
Estimation for queues from queue length data Estimation for queues from queue length data {m c ( )}...family of Markov processes S c Z...state space of m c ( ) Q c = {q c (m, n), m, n S c }...transition rates of m c ( ) c...the number of servers in system (c > 40) Definition Suppose that there exists an open set E R k and a family {f c, c > 0} of continuous functions, with f c : Z k R, such that q c (m, m + l) = cf c ( m, l), l 0. c Then, the family of Markov chains is asymptotically density dependent if, additionally, there exists a function F : E R such that {F c } converges to F pointwise on E, where F c (x) = l lf c(x, l), x E. The transition rates of the corresponding density process X c (t) = mc(t), t > 0, depend on the present state m only through c Katarína Starinská m/c. (starinskak@gmail.com) Arrival and Service Rates 17.12.2012 4 / 22
Estimation for queues from queue length data Law of Large Numbers f c (, l) is bounded for each l and c F is Lipschitz continuous on E F c converges uniformly to F on E Then, if lim c X c (0) = x 0, the density process X c ( ) X (, x) uniformly in probability on [0, t], where X (, x) is the unique trajectory satisfying X (0, x) = x, X (s, x) E, s [0, t] and X (s, x) = F (X (s, x)). s Katarína Starinská (starinskak@gmail.com) Arrival and Service Rates 17.12.2012 5 / 22
Estimation for queues from queue length data Central Limit Law f c (, l) is bounded F is Lipschitz continuous and has uniformly continuous first derivative on E lim c sup x E c Fc (x) F (x) = 0 G c (x) = l l 2 f c (x, l), x E converges uniformly to G, where G is uniformly continuous on E Let x 0 E. Then, if lim c c Xc (0) x 0 = z, the family of processes {Z c ( )}, Z c (s) = c(x c (s) X (s x 0 )), 0 s t, converges weakly in D[0, 1] to a Gaussian diffusion Z( ) with initial value Z(0) = z and with mean and variance given by µ s = EZ(s) = M s z = z exp( σ 2 s = VarZ(s) = M 2 s s 0 s 0 B u du), B s = F (X (s, x 0 )) Mu 2 G(X (u, x 0 ))du. Katarína Starinská (starinskak@gmail.com) Arrival and Service Rates 17.12.2012 6 / 22
Estimation for queues from queue length data X c (s) has an approximate normal distribution with VarX c (s) σ 2 s /c. If we take x 0 = X c (0), then EX c (s) X (s, x 0 ). Corollary If F (x 0 ) = 0 then, under the conditions of Central Limit Law, the family {Z c (s)}, defined by Z c (s) = c(x c (s) x 0 ), 0 s t, converges weakly in D[0, t] to an Ornstein-Uhlenbeck process Z( ) with initial value Z(0) = z, local drift B = F (x 0 ) and local variance V = G(x 0 ). In particular, ( Z(s) N µ s = ze Bs, σs 2 = V ) 2B (e2bs 1) Katarína Starinská (starinskak@gmail.com) Arrival and Service Rates 17.12.2012 7 / 22
Estimation for queues from queue length data For large c, X c (s) has an approximate normal distribution with EX c (s) x 0 + e Bs (X c (0) x 0 ) VarX c (s) σ 2 s /c In case of queueing models, we have B < 0 (x 0 asymptotically stable). OU process is strongly stationary if we start in equilibrium where σ 2 = V / 2B. Therefore Z(0) N(0, σ 2 ) X c (0) N(x 0, σ 2 /c) We may approximate Cov(X c (s), X c (s + t)) by c(t) = 1 σ2 Cov(Z(s), Z(s + t)) = c c exp(b t ) Katarína Starinská (starinskak@gmail.com) Arrival and Service Rates 17.12.2012 8 / 22
Estimation for queues from queue length data The likelihood function of a Gaussian vector (X c (t 1 ), X c (t 2 ),..., X c (t n )) { 1 f (x) = (2π) n C exp 1 } 2 (x m)c 1 (x m) m = x 0 1 n C = (c i,j ) n i,j=1, c i,j = σ2 c exp{b t j t i } Inverse and determinant of C can be computed explicitly. Therefore we can get the maximum likelihood estimators of the parameters. Explicit calculation od the estimators is not practical, therefore we need a numerical optimisation procedure (Cross-Entropy method). Information about parameters from the data E m = cx 0, where m = 1 n n i=1 m c(t i ) E ( 1 n n i=1 (m c(t i ) m) 2) = cσ 2 Katarína Starinská (starinskak@gmail.com) Arrival and Service Rates 17.12.2012 9 / 22
Estimation for queues from queue length data OU approximation for M/M/c queue OU approximation for M/M/c queue Suppose that λ = O(c) (that is λ αc, where α is a constant). Process is density-dependent with F (x) = α µx and G(x) = α + µx. F c (x) = l lf c(x, l). f c (x, l) is non-zero for l = ±1 (and l = 0) F c (x) = 1 f c (x, 1) 1 f c (x, 1) = λ c F (x) = α µx G c (x) = l l 2 f c (x, l). Similarly µ min{m, c} c G c (x) = 1 2 f c (x, 1) + ( 1) 2 f c (x, 1) = λ c G(x) = α + µx + µ min{m, c} c x 0 = α/µ. Traffic intensity λ/(µc) = ρ/c tends to x 0 as c. Therefore, we may interpret x 0 as the asymptotic traffic intensity. Katarína Starinská (starinskak@gmail.com) Arrival and Service Rates 17.12.2012 10 / 22
Estimation for queues from queue length data OU approximation for M/M/c queue We consider the OU approximation about the stable equilibrium x 0 < 1 Local drift is B = F (x 0 ) = µ Local variance is V = G(x 0 ) = 2α, that is approximately 2λ/c For large c, X c (t) has an approximate normal distribution with EX c (t) x 0 + e µt (X c (0) x 0 ), Var X c (t) λ µc 2 (1 e 2µt ) Katarína Starinská (starinskak@gmail.com) Arrival and Service Rates 17.12.2012 11 / 22
Estimation for queues from queue length data OU approximation for M/M/c queue X c (0) N(ρ/c, ρ/c 2 ), cov (X c (s), X c (s + t)) ρ c 2 e µ t Likelihood for the Gaussian vector (X c (t 1 ),..., X c (t n )) is f (x) = { 1 (2π) n C exp 1 } 2 (x m)c 1 (x m), where m = ρ/c1 n and C = (c i,j ) n i,j=1, c i,j = ρ/c 2 exp{ µ t i+s t i } We minimize log-likelihood l(x) = n 2 log(2π) 1 2 log( C ) 1 2 (x m)c 1 (x m). For M/M/c queue, the expected values of the mean and variance of our data set are E [ 1 n E m = ρ (= cx 0 ) ] n (m c (t i ) m) 2 = ρ c (= cσ2 ) i=1 Katarína Starinská (starinskak@gmail.com) Arrival and Service Rates 17.12.2012 12 / 22
Estimation for queues from queue length data Simulation results Large telecommunication system (M/M/300) λ = 25, µ = 0.09, c = 300 Hypothetical system with 300 servers, calls arriving at rate 50 per second, each server being able to process 0.18 calls per second and being sampled every 0.5 of second. Traffic intensity 0.926 5 minute s worth of observations (600 data points), 5 runs The relative errors in the average of this estimates for λ and µ are small, being 2.6% and 2%. Small telecommunication system (M/M/50) λ = 4250/600, µ = 1/6, c = 50 Hypothetical system with 50 servers, calls arriving at rate 4250/300 per minute, each server being able to process 1/3 of a call per minute and being sampled every 30 seconds. Traffic intensity 0.85 2 hours worth of observations (240 data points), 5 runs The relative errors in the average of this estimates for λ and µ are 2.9% and 1.5%. Katarína Starinská (starinskak@gmail.com) Arrival and Service Rates 17.12.2012 13 / 22
Estimation for queues from queue length data Simulation results Shopping queue (M/M/5) λ = 0.75, µ = 0.175, c = 5 Hypothetical system with 5 servers, customers arriving at rate 3 per minute, each server being able to process 0.7 customer per minute and being sampled every 15 seconds. Traffic intensity 0.86 1 hour worth of observations (240 data points), 5 runs The relative errors in the average of this estimates for λ is 7.9% and for µ is 35.7%. Katarína Starinská (starinskak@gmail.com) Arrival and Service Rates 17.12.2012 14 / 22
MLE for single server queues from waiting time data The likelihood function based on the waiting times MLE for single server queues from waiting time data Notation: T n... the time between the arrivals of the n-th and n + 1-th customer W n... the remaining work of the system just before n-th customer arrive U n... the service time of the n-th customer X n = U n T n... i.i.d. random variables, independent of W n W n+1 = (W n + U n T n ) + = (W n + X n ) + Katarína Starinská (starinskak@gmail.com) Arrival and Service Rates 17.12.2012 15 / 22
MLE for single server queues from waiting time data The likelihood function based on the waiting times {W n } is a Markov chain on the state space S = [0, ). The transition distribution function: P (W n+1 y W n = w) = P (W n+1 = 0 W n = w) + + P (0 < W n+1 y W n = w) = = P (w + X n 0) + P (0 < w + X n y) = = F X (y w)i [y 0] Jump at y = 0, with jump-size equal to F X ( w). Katarína Starinská (starinskak@gmail.com) Arrival and Service Rates 17.12.2012 16 / 22
MLE for single server queues from waiting time data The likelihood function based on the waiting times Transition density of W n+1 given W n = w 1 α(w) y = 0 p(y w) = f X (y w) y > 0 0 y < 0 where α(w) = 1 F X ( w) and f X ( ) is the density corresponding to F X ( ) (assumed to exists). p(w n+1 W n ) = (1 α(w n )) 1 Z n+1 f X (W n+1 W n ) Z n+1, where Z n+1 = { 0 W n+1 = 0 1 W n+1 > 0. Katarína Starinská (starinskak@gmail.com) Arrival and Service Rates 17.12.2012 17 / 22
MLE for single server queues from waiting time data The likelihood function based on the waiting times The likelihood function based on sample (W 1, W 2,..., W k ) k 1 L(θ) = p(w 1 ) p(w n+1 W n ) = n=1 k 1 = p(w 1 ) (1 α(w n ; θ)) 1 Z n+1 f X (W n+1 W n ; θ) Z n+1 n=1 where p(w 1 ) is the marginal density of W 1 and θ = (θ 1,..., θ r ) is unknown parameter vector. The likelihood score vector: d ln L dθ = d ln p(w 1; θ) dθ k 1 + n=1 (1 Z n+1 ) dα(w t; θ) (1 α(w t ; θ)) 1 + dθ k 1 n=1 Z t+1 d ln f X (W n+1 W n ; θ) dθ Katarína Starinská (starinskak@gmail.com) Arrival and Service Rates 17.12.2012 18 / 22
MLE for single server queues from waiting time data The consistency and the asymptotic normality of the MLE ˆθ n MLE of θ is typically obtained as a solution of the likelihood equations d ln L dθ = 0. α = EX t = EU t ET t. We assume that α < 0 The first term in the likelihood score vector is asymptotically negligible Define the likelihood score function S n (θ) = n 1 t=1 U t(θ), where U t (θ) =(Z t+1 1) dα(w t; θ) (1 α(w t ; θ)) 1 + dθ d ln f X (W n+1 W n ; θ) + Z t+1 dθ {S n (θ)} is a zero-mean martingale with respect to the σ-field, σ(w n 1,..., W 1 ) The conditional information matrix ξ t (θ) = E[U t (θ)u t(θ) W t ] J n (θ) = n 1 t=1 ξ t(θ). From ergodic theorem n 1 J n (θ) a.s. J(θ) = E[ξ t (θ)] Katarína Starinská (starinskak@gmail.com) Arrival and Service Rates 17.12.2012 19 / 22
MLE for single server queues from waiting time data The consistency and the asymptotic normality of the MLE Consistency and asymptotic normality Next two theorems holds under regularity conditions. Theorem There exists a consistent solution ˆθ n of the equations S n (θ) = 0, with probability tending to 1 as n. Moreover, ˆθ n is a local maximum of L n (θ) with probability tending to 1 as n. Theorem If ˆθ n is any consistent solution of the likelihood equations S n (θ) = 0, then 1 n(ˆθn θ) d N r (0, J 1 (θ)) 2 2(ln L n (ˆθ n ) ln L n (θ)) d χ 2 (r) Katarína Starinská (starinskak@gmail.com) Arrival and Service Rates 17.12.2012 20 / 22
MLE for single server queues from waiting time data Application to M/M/1 λ and µ denote the arrival and service rates The stationarity condition ρ = λ/µ < 1 The density function of X t = U t T t is { λµ λ+µ f x (x) = e µx, 0 x <, λµ λ+µ eλx, < x < 0. F x (x) = P(X t x) = B(x + y)a(dy) 0 B(x + y) = P(U t x + y) = (1 e µ(x+y) )I [x + y 0] A(y) = P(T t y) = (1 e λy )I [y 0] f x (x) = F x(x) α(w) = w f x(y)dy = 1 µ λ+µ e λw To evaluate S n (θ) we need f x (x), α(x) and their partial derivatives, which are easy to compute. Katarína Starinská (starinskak@gmail.com) Arrival and Service Rates 17.12.2012 21 / 22
MLE for single server queues from waiting time data Application to M/M/1 Asmussen S. (2003): Applied Probability and Queues Basawa I.V., Bhat U.N. and Lund R.(1996):Maximum Likelihood Estimation for Single Server Queues from Waiting Time Data. Queueing Systems 24, p. 155-167. Ross J.V., Taimre T. and Pollet P.K.(2007):Estimation of Queues from Queue Length Data. Queueing Systems 55, p. 131-138. Katarína Starinská (starinskak@gmail.com) Arrival and Service Rates 17.12.2012 22 / 22