Stochastic Approximation Root Finder
Implements the Robbins-Monroe stochastic approximation root-finding algorithm with Kesten acceleration and an exponentially weighted stopping criterion.
Algorithm
x_{n+1} = xn - scaleFactor * an * f(xn)
an <- 1 / (1/a_{n-1} + 1) [when sign of f(x) changes — Kesten acceleration]
rsc = alpha * rsc + (1 - alpha) * f(x)
stoppingCriteria = |scaleFactor * an * rsc|Convergence declared when stoppingCriteria < desiredPrecision.
Boundary bounce
Overshoot draws x ~ Uniform from the sub-interval lowerLimit, currentX or currentX, upperLimit using rnStream. If currentX already sits at the violated boundary (degenerate case), the process hard-stops and emits DEGENERATE_BOUNCE.
Observability
stepEmitter Emitter
— per-iteration snapshots, frequency-gated. lifeCycleEmitter Emitter
— unconditional at each lifecycle transition. No SAStep is allocated when nothing is listening and saveSteps is false.
Parameters
Function with a sign-change root within interval.
Bracketing search interval.
Starting candidate root. Defaults to interval midpoint.
Robbins-Monroe step scaling constant. Must be > 0.
RSC smoothing parameter. Must be in 0.0, 1.0.
Iteration budget. Default: DEFAULT_MAX_ITER.
Convergence threshold. Default: DEFAULT_PRECISION.
Stream number from streamProvider. 0 = next available, matching the ExponentialRV convention.
Random number stream provider. Default: KSLRandom.DefaultRNStreamProvider.
Constructors
Properties
Controlled random number stream for all boundary bounce draws. streamNum = 0 requests the next available stream from the provider, matching the convention of ExponentialRV and other KSL random variates.
Controls how frequently stepEmitter fires. Value of N emits every Nth step. Does not affect saveSteps accumulation. Validated > 0 on assignment.
Current stopping criterion: |scaleFactor * rmSeries * rsc|. Convergence declared by checkStoppingCondition when this <desiredPrecision.
Functions
Emits CONVERGED and calls stop() when stoppingCriteria < desiredPrecision. Called by IterativeProcess.stoppingConditionCheck() after each step.
Emits EXHAUSTED when the process ends because all iterations were consumed without convergence. Delegates to super.endIterations() to complete the state-machine transition. Convergence and bounce statuses are emitted at their own sites and do not need re-emission here.
Resets all SA state for a fresh run. super.initializeIterations() resets IterativeProcess bookkeeping and calls setCurrentX(initialPoint), seeding currentX and currentFOfX, before this method reads them.