Package jline.lang.processes
Class MEFit
java.lang.Object
jline.lang.processes.MEFit
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 Summary
Modifier and TypeMethodDescriptionstatic MEfitMeanAndSCV(double mean, double scv) Fits a matrix exponential with the given mean and SCV, without a phase budget.static MEfitMeanAndSCV(double mean, double scv, int maxPhases) Fits a matrix exponential with the given mean and SCV.
-
Method Details
-
fitMeanAndSCV
Fits a matrix exponential with the given mean and SCV, without a phase budget.- Parameters:
mean- target mean, positivescv- target squared coefficient of variation, in (0, 1)- Returns:
- the fitted ME
-
fitMeanAndSCV
Fits a matrix exponential with the given mean and SCV. Forscv < 1the fit is the convolutionX = c*Y + Zof a scaled concentrated matrix exponential Y (unit mean, minimal SCV sY for its order) with an independent exponential Z. Writingc + d = meanandc^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 in2n+2phases. 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 bound1/orderat the same order. The order is the smallest tabulated one that reaches the target, capped bymaxPhaseswhen given: with a phase budget an Erlang can only reach1/maxPhases, while this construction reachesO(1/maxPhases^2), and the residual SCV is then the closest achievable from below.scv >= 1is 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, positivescv- 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
-