Class MEFit

java.lang.Object
jline.lang.processes.MEFit

public final class MEFit extends Object
Fits a matrix exponential to a given mean and squared coefficient of variation. Mirrors MATLAB dist_fit_me.m and the native Python fit_me_mean_scv.
  • Method Details

    • fitMeanAndSCV

      public static ME fitMeanAndSCV(double mean, double scv)
      Fits a matrix exponential with the given mean and SCV, without a phase budget.
      Parameters:
      mean - target mean, positive
      scv - target squared coefficient of variation, in (0, 1)
      Returns:
      the fitted ME
    • fitMeanAndSCV

      public static ME fitMeanAndSCV(double mean, double scv, int maxPhases)
      Fits a matrix exponential with the given mean and SCV. For scv < 1 the fit is the convolution X = c*Y + Z of a scaled concentrated matrix exponential Y (unit mean, minimal SCV sY for its order) with an independent exponential Z. Writing c + d = mean and c^2*sY + d^2 = scv*mean^2,
      c = mean*(1 - sqrt(1 - (1+sY)*(1-scv)))/(1 + sY),   d = mean - c,
      so every target in [sY/(1+sY), 1] is matched EXACTLY in 2n+2 phases. The exponential tail is what makes the convolution reach up to SCV 1; the concentrated part is what makes it reach far below the Erlang bound 1/order at the same order. The order is the smallest tabulated one that reaches the target, capped by maxPhases when given: with a phase budget an Erlang can only reach 1/maxPhases, while this construction reaches O(1/maxPhases^2), and the residual SCV is then the closest achievable from below. scv >= 1 is outside the range of a concentrated ME (its SCV never exceeds 0.34), and the caller keeps its own hyperexponential fit there.
      Parameters:
      mean - target mean, positive
      scv - target squared coefficient of variation, in (0, 1)
      maxPhases - cap on the number of phases, 0 for no cap
      Returns:
      the fitted ME
      Throws:
      IllegalArgumentException - if the mean or the SCV is out of range