LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
npfqn_rqna_weight.m
1function w = npfqn_rqna_weight(t)
2% w = NPFQN_RQNA_WEIGHT(t) - Canonical RBM correlation weight function w*(t)
3% used by the Robust Queueing Network Analyzer (RQNA).
4%
5% w*(t) = 1 - (1 - c*(t))/(2 t), where c*(t) is the correlation function of the
6% stationary version of canonical reflected Brownian motion (drift -1, diffusion
7% coefficient 1),
8%
9% c*(t) = 2(1 - 2t - t^2) Phi^c(sqrt(t)) + 2 sqrt(t) phi(sqrt(t)) (1 + t),
10%
11% with Phi^c the standard-normal complementary cdf and phi its density. The
12% weight is monotonically increasing with w*(0)=0 and w*(Inf)=1.
13% Reference: W. Whitt and W. You (2018), "A Robust Queueing Network Analyzer
14% Based on Indices of Dispersion", eqs. (24)-(25).
15%
16% Input: t - array of nonnegative time arguments
17% Output: w - array of weights w*(t), same shape as t
18
19w = zeros(size(t));
20for idx = 1:numel(t)
21 ti = t(idx);
22 if ti <= 0
23 w(idx) = 0;
24 continue;
25 end
26 if ~isfinite(ti)
27 w(idx) = 1;
28 continue;
29 end
30 st = sqrt(ti);
31 Phic = 0.5*erfc(st/sqrt(2)); % complementary standard-normal cdf
32 phi = exp(-ti/2)/sqrt(2*pi); % standard-normal density at sqrt(t)
33 cstar = 2*(1 - 2*ti - ti^2)*Phic + 2*st*phi*(1 + ti);
34 if ti < 1e-6
35 % limit w*(t) -> 0 as t -> 0; use series to avoid catastrophic cancellation
36 w(idx) = 0;
37 else
38 w(idx) = 1 - (1 - cstar)/(2*ti);
39 end
40 % numerical guard: w* is a weight in [0,1]
41 if w(idx) < 0, w(idx) = 0; end
42 if w(idx) > 1, w(idx) = 1; end
43end
44end
Definition Station.m:245