Package jline.api.mam

Class HyperexpFitLongtail

java.lang.Object
jline.api.mam.HyperexpFitLongtail

public final class HyperexpFitLongtail extends Object
Fitting a hyperexponential to a long-tail distribution.

WHY MOMENTS ARE THE WRONG HANDLE. A Pareto law with tail index below 2 has infinite variance, so no two- or three-moment fit exists at all; and even when the moments are finite, matching them says nothing about the several ORDERS OF MAGNITUDE of time scale over which a long-tail law acts. This procedure matches the CCDF ITSELF at points spread across those decades.

THE RECURSION, with lambda_1 < ... < lambda_k. In the far tail only the slowest component survives, so it is fitted there alone from the ccdf at c_1 and b*c_1 (eqs. 4.4-4.5); subtract it and repeat one decade lower (eqs. 4.6-4.11). The last component takes the remaining probability and its rate follows from the ccdf at c_k (eqs. 4.12-4.14). This is Prony's method applied to a ccdf.

DEFAULTS. (b, decade) = (1.5, 4) rather than the paper's illustrative (2, 10): the fit is exact AT the fitting arguments and free between them, and measured on a Weibull(0.3) the tighter grid cuts the worst between-point error from about 54% to 12%, at the cost of more components.

Port of MATLAB hyperexp_fit_longtail.m.

Reference: A. Feldmann, W. Whitt (1998). Fitting mixtures of exponentials to long-tail distributions to analyze network performance models. Performance Evaluation 31, 245-279, Section 4.

Since:
LINE 3.1.0
  • Field Details

    • DEFAULT_B

      public static final double DEFAULT_B
      The within-scale spacing b of the fitting pairs.
      See Also:
    • DEFAULT_DECADE

      public static final double DEFAULT_DECADE
      The ratio between successive fitting arguments.
      See Also:
  • Method Details

    • hyperexp_fit_longtail

      public static Map<String,Object> hyperexp_fit_longtail(DoubleUnaryOperator ccdf)
      The fit with the component count chosen automatically: one per decade between the 0.9 quantile and the 1e-6 quantile, retrying with fewer when the recursion runs out of probability near the body.
      Parameters:
      ccdf - F^c(t) = P(X > t)
      Returns:
      map with p, lambda, points (double[]), mean, targetMean, coverageLow, coverageHigh, maxRelError and maxRelErrorGrid
    • hyperexp_fit_longtail

      public static Map<String,Object> hyperexp_fit_longtail(DoubleUnaryOperator ccdf, double b, double decade)
      Parameters:
      ccdf - F^c(t) = P(X > t)
      b - the within-scale spacing
      decade - the ratio between successive fitting arguments
      Returns:
      the fit, keyed as in the MATLAB struct
    • hyperexp_fit_longtail_k

      public static Map<String,Object> hyperexp_fit_longtail_k(DoubleUnaryOperator ccdf, int k, double c1, double b, double decade)
      The recursion at a fixed component count.
      Parameters:
      ccdf - F^c(t) = P(X > t)
      k - number of exponential components
      c1 - the largest fitting argument
      b - the within-scale spacing
      decade - the ratio between successive fitting arguments
      Returns:
      the fit, keyed as in the MATLAB struct