Stochastic approximation

From testwiki
Revision as of 09:32, 27 January 2025 by 134.10.78.35 (talk) (Robbins–Monro algorithm)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Template:Short description Stochastic approximation methods are a family of iterative methods typically used for root-finding problems or for optimization problems. The recursive update rules of stochastic approximation methods can be used, among other things, for solving linear systems when the collected data is corrupted by noise, or for approximating extreme values of functions which cannot be computed directly, but only estimated via noisy observations.

In a nutshell, stochastic approximation algorithms deal with a function of the form f(θ)=Eξ[F(θ,ξ)] which is the expected value of a function depending on a random variable ξ. The goal is to recover properties of such a function f without evaluating it directly. Instead, stochastic approximation algorithms use random samples of F(θ,ξ) to efficiently approximate properties of f such as zeros or extrema.

Recently, stochastic approximations have found extensive applications in the fields of statistics and machine learning, especially in settings with big data. These applications range from stochastic optimization methods and algorithms, to online forms of the EM algorithm, reinforcement learning via temporal differences, and deep learning, and others.[1] Stochastic approximation algorithms have also been used in the social sciences to describe collective dynamics: fictitious play in learning theory and consensus algorithms can be studied using their theory.[2]

The earliest, and prototypical, algorithms of this kind are the Robbins–Monro and Kiefer–Wolfowitz algorithms introduced respectively in 1951 and 1952.

Robbins–Monro algorithm

The Robbins–Monro algorithm, introduced in 1951 by Herbert Robbins and Sutton Monro,[3] presented a methodology for solving a root finding problem, where the function is represented as an expected value. Assume that we have a function M(θ), and a constant α, such that the equation M(θ)=α has a unique root at θ*. It is assumed that while we cannot directly observe the function M(θ), we can instead obtain measurements of the random variable N(θ) where E[N(θ)]=M(θ). The structure of the algorithm is to then generate iterates of the form:

θn+1=θnan(N(θn)α)

Here, a1,a2, is a sequence of positive step sizes. Robbins and Monro proved[3], Theorem 2 that θn converges in L2 (and hence also in probability) to θ*, and Blum[4] later proved the convergence is actually with probability one, provided that:

  • N(θ) is uniformly bounded,
  • M(θ) is nondecreasing,
  • M(θ*) exists and is positive, and
  • The sequence an satisfies the following requirements:

n=0an= and n=0an2< A particular sequence of steps which satisfy these conditions, and was suggested by Robbins–Monro, have the form: an=a/n, for a>0. Other series, such as an=1nlnn,1nlnnlnlnn, are possible but in order to average out the noise in N(θ), the above condition must be met.

Example

Consider the problem of estimating the mean θ* of a probability distribution from a stream of independent samples X1,X2,.

Let N(θ):=θX, then the unique solution to E[N(θ)]=0 is the desired mean θ*. The RM algorithm gives usθn+1=θnan(θnXn)This is equivalent to stochastic gradient descent with loss function L(θ)=12Xθ2. It is also equivalent to a weighted average:θn+1=(1an)θn+anXnIn general, if there exists some function L such that L(θ)=N(θ)α, then the Robbins–Monro algorithm is equivalent to stochastic gradient descent with loss function L(θ). However, the RM algorithm does not require L to exist in order to converge.

Complexity results

  1. If f(θ) is twice continuously differentiable, and strongly convex, and the minimizer of f(θ) belongs to the interior of Θ, then the Robbins–Monro algorithm will achieve the asymptotically optimal convergence rate, with respect to the objective function, being E[f(θn)f*]=O(1/n), where f* is the minimal value of f(θ) over θΘ.[5][6]
  2. Conversely, in the general convex case, where we lack both the assumption of smoothness and strong convexity, Nemirovski and Yudin[7] have shown that the asymptotically optimal convergence rate, with respect to the objective function values, is O(1/n). They have also proven that this rate cannot be improved.

Subsequent developments and Polyak–Ruppert averaging

While the Robbins–Monro algorithm is theoretically able to achieve O(1/n) under the assumption of twice continuous differentiability and strong convexity, it can perform quite poorly upon implementation. This is primarily due to the fact that the algorithm is very sensitive to the choice of the step size sequence, and the supposed asymptotically optimal step size policy can be quite harmful in the beginning.[6][8]

Chung (1954)[9] and Fabian (1968)[10] showed that we would achieve optimal convergence rate O(1/n) with an=2f(θ*)1/n (or an=1(nM(θ*))). Lai and Robbins[11][12] designed adaptive procedures to estimate M(θ*) such that θn has minimal asymptotic variance. However the application of such optimal methods requires much a priori information which is hard to obtain in most situations. To overcome this shortfall, Polyak (1991)[13] and Ruppert (1988)[14] independently developed a new optimal algorithm based on the idea of averaging the trajectories. Polyak and Juditsky[15] also presented a method of accelerating Robbins–Monro for linear and non-linear root-searching problems through the use of longer steps, and averaging of the iterates. The algorithm would have the following structure:θn+1θn=an(αN(θn)),θ¯n=1ni=0n1θiThe convergence of θ¯n to the unique root θ* relies on the condition that the step sequence {an} decreases sufficiently slowly. That is

A1) an0,anan+1an=o(an)

Therefore, the sequence an=nα with 0<α<1 satisfies this restriction, but α=1 does not, hence the longer steps. Under the assumptions outlined in the Robbins–Monro algorithm, the resulting modification will result in the same asymptotically optimal convergence rate O(1/n) yet with a more robust step size policy.[15] Prior to this, the idea of using longer steps and averaging the iterates had already been proposed by Nemirovski and Yudin[16] for the cases of solving the stochastic optimization problem with continuous convex objectives and for convex-concave saddle point problems. These algorithms were observed to attain the nonasymptotic rate O(1/n).

A more general result is given in Chapter 11 of Kushner and Yin[17] by defining interpolated time tn=i=0n1ai, interpolated process θn() and interpolated normalized process Un() as

θn(t)=θn+i,Un(t)=(θn+iθ*)/an+ifort[tn+itn,tn+i+1tn),i0Let the iterate average be Θn=anti=nn+t/an1θi and the associate normalized error to be U^n(t)=anti=nn+t/an1(θiθ*).

With assumption A1) and the following A2)

A2) There is a Hurwitz matrix A and a symmetric and positive-definite matrix Σ such that {Un()} converges weakly to U(), where U() is the statisolution to dU=AUdt+Σ1/2dwwhere w() is a standard Wiener process.

satisfied, and define V¯=(A1)Σ(A)1. Then for each t,

U^n(t)𝒟𝒩(0,Vt),whereVt=V¯/t+O(1/t2).

The success of the averaging idea is because of the time scale separation of the original sequence {θn} and the averaged sequence {Θn}, with the time scale of the former one being faster.

Application in stochastic optimization

Suppose we want to solve the following stochastic optimization problemg(θ*)=minθΘE[Q(θ,X)],where g(θ)=E[Q(θ,X)] is differentiable and convex, then this problem is equivalent to find the root θ* of g(θ)=0. Here Q(θ,X) can be interpreted as some "observed" cost as a function of the chosen θ and random effects X. In practice, it might be hard to get an analytical form of g(θ), Robbins–Monro method manages to generate a sequence (θn)n0 to approximate θ* if one can generate (Xn)n0 , in which the conditional expectation of Xn given θn is exactly g(θn), i.e. Xn is simulated from a conditional distribution defined by

E[H(θ,X)|θ=θn]=g(θn).

Here H(θ,X) is an unbiased estimator of g(θ). If X depends on θ, there is in general no natural way of generating a random outcome H(θ,X) that is an unbiased estimator of the gradient. In some special cases when either IPA or likelihood ratio methods are applicable, then one is able to obtain an unbiased gradient estimator H(θ,X). If X is viewed as some "fundamental" underlying random process that is generated independently of θ, and under some regularization conditions for derivative-integral interchange operations so that E[θQ(θ,X)]=g(θ), then H(θ,X)=θQ(θ,X) gives the fundamental gradient unbiased estimate. However, for some applications we have to use finite-difference methods in which H(θ,X) has a conditional expectation close to g(θ) but not exactly equal to it.

We then define a recursion analogously to Newton's Method in the deterministic algorithm:

θn+1=θnεnH(θn,Xn+1).

Convergence of the algorithm

The following result gives sufficient conditions on θn for the algorithm to converge:[18]

C1) εn0,n0.

C2) n=0εn=

C3) n=0εn2<

C4) |Xn|B, for a fixed bound B.

C5) g(θ) is strictly convex, i.e.

infδ|θθ*|1/δθθ*,g(θ)>0, for every 0<δ<1.

Then θn converges to θ* almost surely.

Here are some intuitive explanations about these conditions. Suppose H(θn,Xn+1) is a uniformly bounded random variables. If C2) is not satisfied, i.e. n=0εn< , thenθnθ0=i=0n1εiH(θi,Xi+1)is a bounded sequence, so the iteration cannot converge to θ* if the initial guess θ0 is too far away from θ*. As for C3) note that if θn converges to θ* then

θn+1θn=εnH(θn,Xn+1)0, as n. so we must have εn0 ,and the condition C3) ensures it. A natural choice would be εn=1/n. Condition C5) is a fairly stringent condition on the shape of g(θ); it gives the search direction of the algorithm.

Example (where the stochastic gradient method is appropriate)[8]

Suppose Q(θ,X)=f(θ)+θTX, where f is differentiable and Xp is a random variable independent of θ. Then g(θ)=E[Q(θ,X)]=f(θ)+θTEX depends on the mean of X, and the stochastic gradient method would be appropriate in this problem. We can choose H(θ,X)=θQ(θ,X)=θf(θ)+X.

Kiefer–Wolfowitz algorithm

The Kiefer–Wolfowitz algorithm was introduced in 1952 by Jacob Wolfowitz and Jack Kiefer,[19] and was motivated by the publication of the Robbins–Monro algorithm. However, the algorithm was presented as a method which would stochastically estimate the maximum of a function.

Let M(x) be a function which has a maximum at the point θ. It is assumed that M(x) is unknown; however, certain observations N(x), where E[N(x)]=M(x), can be made at any point x. The structure of the algorithm follows a gradient-like method, with the iterates being generated as

xn+1=xn+an(N(xn+cn)N(xncn)2cn)

where N(xn+cn) and N(xncn) are independent. At every step, the gradient of M(x) is approximated akin to a central difference method with h=2cn. So the sequence {cn} specifies the sequence of finite difference widths used for the gradient approximation, while the sequence {an} specifies a sequence of positive step sizes taken along that direction.

Kiefer and Wolfowitz proved that, if M(x) satisfied certain regularity conditions, then xn will converge to θ in probability as n, and later Blum[4] in 1954 showed xn converges to θ almost surely, provided that:

  • Var(N(x))S< for all x.
  • The function M(x) has a unique point of maximum (minimum) and is strong concave (convex)
    • The algorithm was first presented with the requirement that the function M() maintains strong global convexity (concavity) over the entire feasible space. Given this condition is too restrictive to impose over the entire domain, Kiefer and Wolfowitz proposed that it is sufficient to impose the condition over a compact set C0d which is known to include the optimal solution.
  • The function M(x) satisfies the regularity conditions as follows:
    • There exists β>0 and B>0 such that |xθ|+|xθ|<β|M(x)M(x)|<B|xx|
    • There exists ρ>0 and R>0 such that |xx|<ρ|M(x)M(x)|<R
    • For every δ>0, there exists some π(δ)>0 such that |zθ|>δinfδ/2>ε>0|M(z+ε)M(zε)|ε>π(δ)
  • The selected sequences {an} and {cn} must be infinite sequences of positive numbers such that
    • cn0asn
    • n=0an=
    • n=0ancn<
    • n=0an2cn2<

A suitable choice of sequences, as recommended by Kiefer and Wolfowitz, would be an=1/n and cn=n1/3.

Subsequent developments and important issues

  1. The Kiefer Wolfowitz algorithm requires that for each gradient computation, at least d+1 different parameter values must be simulated for every iteration of the algorithm, where d is the dimension of the search space. This means that when d is large, the Kiefer–Wolfowitz algorithm will require substantial computational effort per iteration, leading to slow convergence.
    1. To address this problem, Spall proposed the use of simultaneous perturbations to estimate the gradient. This method would require only two simulations per iteration, regardless of the dimension d.[20]
  2. In the conditions required for convergence, the ability to specify a predetermined compact set that fulfills strong convexity (or concavity) and contains the unique solution can be difficult to find. With respect to real world applications, if the domain is quite large, these assumptions can be fairly restrictive and highly unrealistic.

Further developments

An extensive theoretical literature has grown up around these algorithms, concerning conditions for convergence, rates of convergence, multivariate and other generalizations, proper choice of step size, possible noise models, and so on.[21][22] These methods are also applied in control theory, in which case the unknown function which we wish to optimize or find the zero of may vary in time. In this case, the step size an should not converge to zero but should be chosen so as to track the function.[21], 2nd ed., chapter 3

C. Johan Masreliez and R. Douglas Martin were the first to apply stochastic approximation to robust estimation.[23]

The main tool for analyzing stochastic approximations algorithms (including the Robbins–Monro and the Kiefer–Wolfowitz algorithms) is a theorem by Aryeh Dvoretzky published in 1956.[24]

See also

References

Template:Reflist

Template:Statistics

  1. Template:Cite journal
  2. Template:Cite web
  3. 3.0 3.1 Template:Cite journal
  4. 4.0 4.1 Template:Cite journal
  5. Template:Cite journal
  6. 6.0 6.1 Template:Cite journal
  7. Problem Complexity and Method Efficiency in Optimization, A. Nemirovski and D. Yudin, Wiley -Intersci. Ser. Discrete Math 15 John Wiley New York (1983) .
  8. 8.0 8.1 Introduction to Stochastic Search and Optimization: Estimation, Simulation and Control, J.C. Spall, John Wiley Hoboken, NJ, (2003).
  9. Template:Cite journal
  10. Template:Cite journal
  11. Template:Cite journal
  12. Template:Cite journal
  13. Template:Cite journal
  14. Template:Cite report
  15. 15.0 15.1 Template:Cite journal
  16. On Cezari's convergence of the steepest descent method for approximating saddle points of convex-concave functions, A. Nemirovski and D. Yudin, Dokl. Akad. Nauk SSR 2939, (1978 (Russian)), Soviet Math. Dokl. 19 (1978 (English)).
  17. Template:Cite book
  18. Template:Cite book
  19. Template:Cite journal
  20. Template:Cite journal
  21. 21.0 21.1 Template:Cite book
  22. Stochastic Approximation and Recursive Estimation, Mikhail Borisovich Nevel'son and Rafail Zalmanovich Has'minskiĭ, translated by Israel Program for Scientific Translations and B. Silver, Providence, RI: American Mathematical Society, 1973, 1976. Template:Isbn.
  23. Template:Cite journal
  24. Template:Cite conference