![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Fit a superposition of interrupted Poisson processes to a Hurst parameter. More...
#include <cmath>#include <cstddef>#include <vector>#include "line/api/mam/map_moment.h"#include "line/api/mam/mmap_lambda.h"#include "line/api/mam/map_transform.h"#include "line/num/number.h"#include "line/util/auglag.h"#include "line/util/error.h"#include "line/util/matrix.h"Go to the source code of this file.
Classes | |
| struct | line::mam::MapAnfitResult< T > |
| What map_anfit returns: the fitted MAP and the ladder it was built on. More... | |
Namespaces | |
| namespace | line |
| namespace | line::mam |
Functions | |
| template<class T> | |
| MapAnfitResult< T > | line::mam::map_anfit (const T &ls, const T &rho, const T &H, double n, std::size_t ds) |
| Fit a superposition of interrupted Poisson processes to a Hurst parameter. | |
| template<class T> | |
| MapAnfitResult< T > | line::mam::map_anfit_lsq (const T &ls, const T &rho, const T &H, double n, std::size_t ds, const std::vector< T > &SA, const std::vector< unsigned > &SAlags, unsigned iter_max=100) |
| The least-squares variant: after the deterministic construction, the per-IPP ratios are tuned so the fitted autocorrelation matches a supplied one. | |
Fit a superposition of interrupted Poisson processes to a Hurst parameter.
Templated port of matlab/lib/kpctoolbox/map/map_anfit.m (Andersen-Nielsen). The construction builds d two-state IPPs whose switching rates form a geometric ladder k(2,i) = a^(1-i) k(2,1) with a = 10^(n/(d-1)), and whose weights phi(i) are chosen so that the aggregate variance-time curve follows t^beta with beta = 2 - 2H over n decades. Superposing them with an optional Poisson remainder gives a MAP whose autocorrelation decays like a fractional process over that range, which is what makes it a long-range-dependence surrogate rather than a moment fit.
The phi ladder is built by the reference's backward recursion D = a^(i beta) - sum_{j<i} phi(d-j)^2 exp(1 - a^(i-j)), phi(d-i) = sqrt(D) when D >= 0, else 0 and the depth d is grown by one, which is a greedy fill: a level that cannot carry positive variance is set to zero and the ladder is extended instead of failing.
REFERENCE INCONSISTENCY, resolved in favour of the least-squares branch. map_anfit.m builds the Poisson remainder as map_exponential(lP), and the global map_exponential takes a MEAN, whereas the file's own objfun builds the SAME component as {[-lP], [lP]}, i.e. with lP as a RATE. The two cannot both be right. The rate reading is taken here, for two reasons: objfun is unambiguous, and lP = 0 – which the ls < L branch produces deliberately to mean "no Poisson remainder" – is the null stream under the rate reading and a division by zero under the mean reading.
THE LEAST-SQUARES BRANCH replaces MATLAB's fmincon with line/util/auglag.h, whose header carries the acceptance contract for that substitution. It minimizes the 2-norm between the fitted autocorrelation and the supplied one over the per-IPP ratios r(i), subject to the reference's feasibility constraint ls(i) >= sqrt(k1(i) k2(i) / r(i)), which is what keeps the second IPP rate non-negative.
ARITHMETIC: transcendental.
Definition in file map_anfit.h.