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

The DISCRETE twins of map_optim_dist / map_optim_dist_acf: fit a D-MAP's D1 by minimizing a distance to a reference, with D0 held fixed. More...

#include <cstddef>
#include <string>
#include <vector>
#include "line/api/mam/dmap.h"
#include "line/api/mam/map_optim_dist.h"
#include "line/num/number.h"
#include "line/util/error.h"
#include "line/util/lu.h"
#include "line/util/matrix.h"
Include dependency graph for dmap_optim_dist.h:

Go to the source code of this file.

Namespaces

namespace  line
namespace  line::mam

Functions

template<class T>
MapOptimDist< T > line::mam::dmap_optim_dist (const Dmap< T > &a, const std::vector< T > &alA, const Matrix< T > &B0, const std::vector< T > &alB, unsigned L)
 Fit B1 minimizing the lag-L joint-PMF distance to a, with B0 fixed.
template<class T>
MapOptimDist< T > line::mam::dmap_optim_dist_acf (const Dmap< T > &a, const std::vector< T > &alA, const Matrix< T > &B0, const std::vector< T > &alB)
 Fit B1 minimizing the AUTOCORRELATION distance, with B0 fixed.

Detailed Description

The DISCRETE twins of map_optim_dist / map_optim_dist_acf: fit a D-MAP's D1 by minimizing a distance to a reference, with D0 held fixed.

Port of matlab/lib/kpctoolbox/dmap/dmap_optim_dist.m and dmap_optim_dist_acf.m (twins in python/line_solver/api/mapdist/discrete.py). The distances themselves – dmap_dist, dmap_dist_acf – are already in dmap.h.

EVERYTHING IS THE CONTINUOUS CASE WITH (-D0) REPLACED BY (I - D0), and that substitution is the whole of the discrete/continuous difference here. In continuous time the embedded kernel is (-D0)^-1 D1 and the row sums of D0 and D1 cancel; in discrete time the phase either moves without an arrival (D0) or with one (D1) at every SLOT, so the two together form a stochastic matrix, the kernel is (I - D0)^-1 D1, and the row sums are ONE rather than zero. Both constraint blocks change accordingly:

  • alB (I - B0)^-1 B1 = alB, alB stationary at arrivals;
  • the row sums of B1 are those of (I - B0).

There is no convex quadratic branch here. The continuous map_optim_dist takes one at L = 1 because quadprog applies; the discrete reference calls fmincon at every lag, so every result is a LOCAL optimum and none claims otherwise.

ARITHMETIC: transcendental, inherited from the distances.

Definition in file dmap_optim_dist.h.