Class FluidRefineMeanfield

java.lang.Object
jline.solvers.fluid.moments.FluidRefineMeanfield

public class FluidRefineMeanfield extends Object
Refined mean field correction of a fluid fixed point (Gast and Van Houdt, POMACS 1(2), 2017).

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:
  • 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 point
      sigma2 - per-station population variances defining the smooth drift
      sigma - (n x n) stationary covariance
      terms - representation from FluidMomentTerms
      covblk - 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 refine
      h0 - h at the mean-field fixed point under the first-order closure
      x - mean-field fixed point
      V - correction from refine(double[], double[], jline.util.matrix.Matrix, jline.solvers.fluid.moments.FluidMomentTerms, jline.util.matrix.Matrix[])
      sigma2 - per-station population variances defining the smooth h
      sigma - (n x n) stationary covariance
      covblk - per-station covariance blocks closing the DPS share ratio
      Returns:
      the refined estimate, clipped at zero, as a column vector