Experiment: I-ratio identity, random problems

What is checked

The identity \( \|\sum_i g_i\|^2 = D\,(1 + 2I) \), with \( D = \sum_i \|g_i\|^2 \), gives \( I = -\frac{1}{2} \) exactly when the gradients sum to zero. This experiment evaluates the implementation on randomly generated problems with different (K, dimension) pairs, complementing the systematic sweep in exp-iratio-proof. The checks test the code against an algebraic identity; nothing beyond the identity is being tested.

Method

Setup: Two test configurations with different (K, dimension) pairs, using randomly generated gradient vectors.

Parameters:

  • Configuration 1: K=3 objectives, 4-dimensional parameter space, 50 random instances
  • Configuration 2: K=5 objectives, 2-dimensional parameter space, 20 random instances
  • Balanced construction: generate K-1 random gradients, set \( g_K = -\sum_{i=1}^{K-1} g_i \)
  • Tolerance: \( |I + 0.5| < 10^{-10} \)

Procedure: For each instance, construct a gradient set with \( \sum g_i = 0 \), compute \( I(\theta) \), and check that it equals \( -0.5 \) within tolerance.

Results

ConfigurationKDimensionPassTotalStatus
Config 134D5050Pass
Config 252D2020Pass

Precision

MetricValue
Maximum absolute error\(2.22 \times 10^{-16}\)
All tests within tolerance70/70

Analysis

The two configurations cover both sides of \( K \) versus dimension \( d \):

  • K=3, 4D: Fewer objectives than dimensions; 3 vectors in 4D do not span the space. \( I = -0.5 \) holds to rounding.
  • K=5, 2D: More objectives than dimensions; the 5 gradient vectors lie in a plane. \( I = -0.5 \) holds to rounding.

Both configurations reach the same maximum error of \( 2.22 \times 10^{-16} \) (1 ULP), as expected for an identity that does not depend on whether \( K > d \) or \( K < d \).

Together with the systematic sweep (57/57) and random problems (70/70) in exp-iratio-proof, 197 instances evaluate the identity to double-precision rounding.

Summary

Pass — 70/70 random instances agree with the identity to 1 ULP, in both the \( K > d \) and \( K < d \) regimes.

Reproducibility

../simplex/build/sxc exp_iratio_proof_statistical.sx -o build/exp_iratio_proof_statistical.ll
clang -O2 build/exp_iratio_proof_statistical.ll ../simplex/runtime/standalone_runtime.c \
  -o build/exp_iratio_proof_statistical -lm -lssl -lcrypto -L$(brew --prefix openssl)/lib
./build/exp_iratio_proof_statistical

Related