LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
infer_mlps.h File Reference

Maximum-likelihood service-demand estimation at a processor-sharing queue. More...

#include <algorithm>
#include <cmath>
#include <cstddef>
#include <limits>
#include <map>
#include <string>
#include <vector>
#include "line/api/infer/infer_rps.h"
#include "line/api/mam/map_pdf.h"
#include "line/lang/qn/network_builder.h"
#include "line/lang/qn/network_struct.h"
#include "line/num/number.h"
#include "line/solvers/ctmc/solver_ctmc_getters.h"
#include "line/util/error.h"
#include "line/util/matrix.h"
#include "line/util/neldermead.h"
Include dependency graph for infer_mlps.h:

Go to the source code of this file.

Classes

struct  line::api::MlpsSample
 One observation: a response time, the tagged class, and the arrival state. More...

Namespaces

namespace  line
namespace  line::api

Functions

std::vector< double > line::api::infer_mlps (const std::vector< double > &muZ, double nCores, const std::vector< MlpsSample > &samples)
 MLPS demand estimation at a PS queue.
std::vector< double > line::api::infer_minps (const std::vector< double > &muZ, double nCores, const std::vector< MlpsSample > &samples)
 MINPS: run MLPS and RPS and keep whichever gives the smaller mean demand.

Detailed Description

Maximum-likelihood service-demand estimation at a processor-sharing queue.

Port of matlab/src/api/infer/infer_mlps.m and infer_minps.m. THESE ARE MATLAB-ONLY: there is no JAR or native-Python twin, so MATLAB is not merely the ground truth here, it is the only prior art.

WHAT MLPS IS. Each observation is a response time rt, the class of the tagged job, and the per-class queue length seen ON ARRIVAL. For a given vector of mean demands, the sojourn of a tagged job that arrives into a known queue state is the absorption time of a small CTMC: build the same PS queue with one EXTRA class carrying the tagged job, mark every transition that is the tagged job departing, and the remaining sub-generator is the phase-type representation of that sojourn. The likelihood of one sample is that phase-type density at rt, and the estimate maximizes their product.

WHY THE AUGMENTED MODELS ARE BUILT ONCE. The state space, the departure event indices and the absorbing subset depend only on the (tagged class, arrival queue length) PAIR, not on the demands being optimized. The reference caches them per distinct pair and rebuilds only the rates inside the objective; so does this port, because the enumeration is the expensive part and it would otherwise be repeated once per likelihood evaluation.

TWO SUBSTITUTIONS FOR MATLAB:

  1. fmincon with BOX bounds only and no other constraint is nelder_mead_box. The reference passes empty A, b, Aeq, beq and no nonlinear constraint, so the interior-point machinery is doing nothing an ordinary box-constrained minimizer does not; the objective is a smooth log-likelihood in a handful of variables.
  2. sn_set_service_coc HAS NO C++ COUNTERPART AND NEEDS NONE. It exists only to write MATLAB's sn.mu{i}{k} cell-of-cells without reshaping the cell array, a storage quirk of that language; here the service law is sn.service[i][r], an ordinary vector, and setting it is setting it.

ARITHMETIC: double. The optimizer and the phase-type density are floating point, and the reference's tolerances are absolute in double.

Definition in file infer_mlps.h.