![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Kolmogorov-Smirnov tests for a non-homogeneous Poisson arrival process. More...
#include <algorithm>#include <cmath>#include <cstddef>#include <functional>#include <string>#include <vector>#include "line/num/number.h"#include "line/util/error.h"Go to the source code of this file.
Classes | |
| struct | line::infer::NhppKsResult< T > |
| Outcome of the KS test. More... | |
Namespaces | |
| namespace | line |
| Conservation laws of a layered queueing network, enumerated from its structure. | |
| namespace | line::infer |
Enumerations | |
| enum class | line::infer::NhppKsMethod { line::infer::Cu , line::infer::Lewis , line::infer::Tt } |
| Which test to run on the conditional-uniform data. More... | |
Functions | |
| template<class Tv> | |
| NhppKsResult< Tv > | line::infer::infer_nhpp_ks (const std::vector< Tv > ×, const Tv &T, const std::function< Tv(const Tv &)> &cumRate=std::function< Tv(const Tv &)>(), NhppKsMethod method=NhppKsMethod::Lewis, const Tv &T0=num_traits< Tv >::from_int(0)) |
| Kolmogorov-Smirnov tests for a non-homogeneous Poisson arrival process. | |
Kolmogorov-Smirnov tests for a non-homogeneous Poisson arrival process.
Templated port of matlab/src/api/infer/infer_nhpp_ks.m, cross-checked against jar/src/main/java/jline/api/infer/InferNhppKs.java.
THE CONDITIONAL-UNIFORM TRANSFORMATION. Conditional on the number of arrivals in [T0,T], the arrival times of an NHPP are the order statistics of iid variables with cdf Lambda(t)/Lambda(T). Mapping the data through that cdf turns ANY NHPP, whatever its rate, into iid uniforms, so one KS test covers every rate function.
WHY THE PLAIN TEST IS WEAK, AND WHAT FIXES IT. The CU KS test has "remarkably little power" against non-exponential interarrival times: it looks at the POSITIONS of the points, and those stay nearly uniform for many non-Poisson processes. Lewis (1965) applies the Durbin (1961) transformation first – reorder the GAPS ascending, rescale each by how many gaps remain, cumulate – which turns a difference in the gap DISTRIBUTION into a difference in position. Measured on 400 replications of an Erlang-4 renewal process, the CU test rejects at its own size while the Lewis test rejects essentially always.
TESTING A GIVEN RATE. Tt is the time-transformation test of Nelson and Leemis (2020, Section 5): the arrivals are mapped to Lambda(T_i) - Lambda(T0), a rate-1 Poisson process under the null, and their gaps are KS-tested against the unit exponential. It tests the rate itself, and needs a cumRate obtained from other data: the same paper shows Poissonness cannot be tested from one path when the rate is fitted to that path.
ARITHMETIC. exp and sqrt in the p-value: transcendental only.
Reference: S.-H. Kim, W. Whitt (2014). Are call center and hospital arrivals well modeled by nonhomogeneous Poisson processes? M&SOM 16(3), 464-480; J. Durbin (1961), Biometrika 48, 41-55; P. A. W. Lewis (1965), JRSS B 27; B. L. Nelson, L. M. Leemis (2020), Proc. Winter Simulation Conference, 266-276 (the Tt test).
Definition in file infer_nhpp_ks.h.