Class StochasticApproximationRootFinder

  • All Implemented Interfaces:
    ObservableIfc, IterativeProcessIfc, GetNameIfc

    public class StochasticApproximationRootFinder
    extends IPRootFinder
    This class implements a basic 1-D stochastic approximation algorithm Robbins, H., and S. Monroe(1951). On a Stochastic Approximation Technique. Annals of Mathematical Statistics 22, pp 400-407. Kesten, H.(1958). Accelerated Stochastic Approximation. Annals of Mathematical Statistics 29, pp 41-59. Kesten, H.(1958). Accelerated Stochastic Approximation. Annals of Mathematical Statistics 29, pp 41-59. Suri, R., and Y. T.Leung(1987). Single Run Optimization of Discrete Event Simulation: An Empirical Study Using the M/M/1 Queue. Technical Report No. 87-3, Department of Industrial Engineering, University of Wisconsin, at Madison. Suri, R., and Y. T.Leung(1987). Single Run Optimization of a Siman Model for Closed Loop Flexible Assembly Systems. In the Proceedings of the 1987 Winter Simulation Conference. Rossetti M. D. and Clark G. M. (1998) Evaluating an Approximation for the Two Type Stoppage Machine Interference Model Via Simulation Optimization, Computers and Industrial Engineering, Vol. 34, No. 3, pp. 655-688. This implementation uses a stopping criteria suggested by Suri and Leung and uses the suggested acceleration method proposed by Kesten.
    • Field Detail

      • myDesiredPrecision

        protected double myDesiredPrecision
        Desired precision.
      • myAlpha

        protected double myAlpha
        The smoothing parameter
      • myRSC

        protected double myRSC
        Used in the exponentially weighted stopping criteria
      • myScaleFactor

        protected double myScaleFactor
        Scale addFactor can be used in accelerated procedure
      • myRMSeries

        protected double myRMSeries
        The stepping series
      • myPrevX

        protected double myPrevX
        Used to remember the last root
      • myPrevFofX

        protected double myPrevFofX
        Used to remember the last evaluation
    • Constructor Detail

      • StochasticApproximationRootFinder

        public StochasticApproximationRootFinder​(FunctionIfc func,
                                                 Interval interval)
        Constructs a stochastic approximation root finder for the function, using default scale addFactor and mid-point of interval as initial point
        Parameters:
        func -
        interval -
      • StochasticApproximationRootFinder

        public StochasticApproximationRootFinder​(FunctionIfc func,
                                                 double xLower,
                                                 double xUpper)
        Constructs a stochastic approximation root finder for the function, using default scale addFactor and mid-point of interval as initial point
        Parameters:
        func -
        xLower - - a lower limit on the search, initial point must be > xLower
        xUpper - - an upper limit on the search, initial point must be < xUpper
      • StochasticApproximationRootFinder

        public StochasticApproximationRootFinder​(FunctionIfc func,
                                                 double initialPt,
                                                 double xLower,
                                                 double xUpper)
        Constructs a stochastic approximation root finder for the function, using default scale addFactor
        Parameters:
        func -
        initialPt - the initial point for the search
        xLower - - a lower limit on the search, initial point must be > xLower
        xUpper - - an upper limit on the search, initial point must be < xUpper
      • StochasticApproximationRootFinder

        public StochasticApproximationRootFinder​(FunctionIfc func,
                                                 double initialPt,
                                                 double scaleFactor,
                                                 double xLower,
                                                 double xUpper)
        Constructs a stochastic approximation root finder for the function
        Parameters:
        func -
        initialPt - the initial point for the search
        scaleFactor - - the scale addFactor used during the search
        xLower - - a lower limit on the search, initial point must be > xLower
        xUpper - - an upper limit on the search, initial point must be < xUpper
    • Method Detail

      • setScaleFactor

        public void setScaleFactor​(double scaleFactor)
        Sets the scale addFactor used during the search process
        Parameters:
        scaleFactor - , must be > 0.0
      • getScaleFactor

        public double getScaleFactor()
        Gets the current scale addFactor value
        Returns:
      • getDesiredPrecision

        public double getDesiredPrecision()
        Returns the desired precision.
      • setDesiredPrecision

        public void setDesiredPrecision​(double prec)
        Defines the desired precision.
        Parameters:
        prec - , must be > 0.0
      • getSmoothingParameter

        public final double getSmoothingParameter()
        Returns the smoothing parameter
        Returns:
      • setSmoothingParameter

        public final void setSmoothingParameter​(double alpha)
        Sets the smoothing parameter.
        Parameters:
        alpha - , must be in [0,1]
      • recommendScalingFactor

        public double recommendScalingFactor​(double initialPt,
                                             double delta)
        Uses a linear approximation to recommend a scaling addFactor that can be used during the search
        Parameters:
        initialPt -
        delta - - defines an interval +/- delta around initialPt to make linear approximation
        Returns:
      • hasNext

        protected boolean hasNext()
        Continues until hasConverged() is true or max iterations is reached
        Specified by:
        hasNext in class IterativeProcess<RootFinderStep>
        Returns:
        true if another step is present
      • hasConverged

        public boolean hasConverged()
        Check to see if the result has been attained.
        Specified by:
        hasConverged in class IPRootFinder
        Returns:
        boolean
      • getStoppingCriteria

        public double getStoppingCriteria()
        Gets the stopping criteria of the search
        Returns:
      • toString

        public java.lang.String toString()
        Returns a String representation
        Overrides:
        toString in class IPRootFinder
        Returns:
        A String with basic results
      • runStep

        protected void runStep()
        Tells the process to run (execute) the current step. Moves to the next step if available and updates current step of the process
        Specified by:
        runStep in class IterativeProcess<RootFinderStep>