![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Logistic-sampling estimate of the normalizing constant of a closed product-form network. More...
#include <cmath>#include <cstddef>#include <limits>#include <vector>#include "line/api/pfqn/pfqn_asympt_common.h"#include "line/api/pfqn/pfqn_le.h"#include "line/api/pfqn/pfqn_mc_common.h"#include "line/num/number.h"#include "line/util/error.h"#include "line/util/linalg.h"#include "line/util/matrix.h"Go to the source code of this file.
Classes | |
| struct | line::pfqn::LsResult< T > |
| Return value of pfqn_ls, mirroring [Gn, lGn]. More... | |
Namespaces | |
| namespace | line |
| namespace | line::pfqn |
Functions | |
| template<class T> | |
| LsResult< T > | line::pfqn::pfqn_ls (const Matrix< T > &L0, const std::vector< T > &N, const std::vector< T > &Z, std::size_t I, McRng &rng) |
| Logistic-sampling estimate of the normalizing constant of a closed product-form network. | |
| template<class T> | |
| LsResult< T > | line::pfqn::pfqn_ls (const Matrix< T > &L, const std::vector< T > &N, const std::vector< T > &Z, McRng &rng) |
| Reference default of 1e5 samples. | |
Logistic-sampling estimate of the normalizing constant of a closed product-form network.
Templated port of matlab/src/api/pfqn/pfqn_ls.m, cross-checked against jar/src/main/java/jline/api/pfqn/nc/Pfqn_ls.java. Reference: G. Casale, "Accelerating performance inference over closed systems by asymptotic methods", ACM SIGMETRICS 2017.
The integral representation used by pfqn_le is estimated by importance sampling rather than by a Laplace expansion: the proposal is the Gaussian N(x0, A^{-1}) whose mode x0 and precision A are exactly the fixed point and Hessian that pfqn_le computes (pfqn_le_fpi / pfqn_le_hessian for Z = 0, pfqn_le_fpiZ / pfqn_le_hessianZ otherwise), and the estimate is the self-normalized average of the log-weights lr = log h(x) - log q(x). Where pfqn_le keeps only the quadratic term of the expansion, pfqn_ls corrects it by Monte Carlo, so it is the same asymptotic device made consistent.
Everything stays in the log domain: exponentiating either the integrand or the normal density overflows once lG reaches a few hundred nats, and the exp(-gammaln) prefactor then underflows, which is the NaN the reference's comments record.
Deviations from the reference, both deliberate:
Arithmetic: INEXACT BY CONSTRUCTION. The estimate is a random variable; the proposal is Gaussian, the mode comes from a tolerance-stopped fixed-point iteration, and every weight is a log.
RNG contract: see pfqn_mc_common.h. Comparable to MATLAB only in distribution, never stream for stream; reproducible within this port only when the generator is passed in the same state.
Definition in file pfqn_ls.h.