Class FluidRefineMeanfield
The mean-field fixed point x* is the leading term of an expansion of the true stationary mean in powers of the system size. The next term is obtained by carrying the second moment through the drift: writing A for the Jacobian at x* and B for its Hessian tensor, the correction V solves the linear system
A*V + (1/2) * sum_{j,k} Sigma_{jk} * d2F/dx_j dx_k = 0
with Sigma the stationary covariance from FluidLyapunov. Because Sigma
scales with the population, V is the O(1/N) term of the expansion written
directly in job counts, so no explicit density rescaling is needed. The Hessian
contraction is evaluated WITHOUT EVER FORMING THE TENSOR: writing
Sigma = sum_m lam_m*v_m*v_m' by eigendecomposition,
sum_{jk} Sigma_{jk} d2F/dx_j dx_k = sum_m lam_m * d2F/dv_m^2
and each directional second derivative is one central second difference, so the
cost is O(rank(Sigma)) drift evaluations rather than O(n^2).
The drift must be TWICE DIFFERENTIABLE for this to mean anything. The
first-order closure is only piecewise linear -- its second derivative is zero
away from the kink and a delta at it -- so this must be called on the
Gaussian-closed drift, i.e. with the sigma2 that the moment closure converged to
under options.method='mnrefined'. Passing sigma2 = 0 is rejected rather
than silently returning zero.
Port of matlab/src/solvers/FLD/fluid_refine_meanfield.m.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThe correction, plus what it took to compute it.static interfaceA vector-valued function of the fluid state under a given closure. -
Method Summary
Modifier and TypeMethodDescriptionstatic Matrixobservable(FluidRefineMeanfield.StateFunction h, Matrix h0, double[] x, double[] V, double[] sigma2, Matrix sigma, Matrix[] covblk) Refined estimate of E[h(X)] to the same O(1/N) order as the refined mean.static FluidRefineMeanfield.Resultrefine(double[] x, double[] sigma2, Matrix sigma, FluidMomentTerms terms, Matrix[] covblk) The O(1/N) correction of a fluid fixed point.
-
Method Details
-
refine
public static FluidRefineMeanfield.Result refine(double[] x, double[] sigma2, Matrix sigma, FluidMomentTerms terms, Matrix[] covblk) The O(1/N) correction of a fluid fixed point.- Parameters:
x- fluid fixed pointsigma2- per-station population variances defining the smooth driftsigma- (n x n) stationary covarianceterms- representation fromFluidMomentTermscovblk- per-station covariance blocks closing the DPS share ratio- Returns:
- the correction and its diagnostics
-
observable
public static Matrix observable(FluidRefineMeanfield.StateFunction h, Matrix h0, double[] x, double[] V, double[] sigma2, Matrix sigma, Matrix[] covblk) Refined estimate of E[h(X)] to the same O(1/N) order as the refined mean.h(x* + V) is NOT the refined expectation of a nonlinear h: with h the event rates it breaks flow balance (a delay plus two PS queues at N=6 read 1.80 at one queue against 1.41 at the delay). The expansion is h0 + Dh*V + (1/2) sum_jk Sigma_jk d2h/dx_j dx_k, with h0 = h at the mean-field point under the first-order closure and the derivatives taken on the Gaussian-closed h, the same mixture
refine(double[], double[], jline.util.matrix.Matrix, jline.solvers.fluid.moments.FluidMomentTerms, jline.util.matrix.Matrix[])solves V with. For h the event rates D*h0 = 0 and D times the other two terms is A*V + b = 0, so the rates balance by construction.Port of
matlab/src/solvers/FLD/fluid_refine_observable.m.- Parameters:
h- the function to refineh0- h at the mean-field fixed point under the first-order closurex- mean-field fixed pointV- correction fromrefine(double[], double[], jline.util.matrix.Matrix, jline.solvers.fluid.moments.FluidMomentTerms, jline.util.matrix.Matrix[])sigma2- per-station population variances defining the smooth hsigma- (n x n) stationary covariancecovblk- per-station covariance blocks closing the DPS share ratio- Returns:
- the refined estimate, clipped at zero, as a column vector
-