STK: a Small (Matlab/Octave) Toolbox for Kriging
 STK_DISTRIB_NORMAL_EI computes the normal (Gaussian) expected improvement

 CALL: EI = stk_distrib_normal_ei (Z)

    computes the expected improvement of a standard normal (Gaussian)
    random variable above the threshold Z.

 CALL: EI = stk_distrib_normal_ei (Z, MU, SIGMA)

    computes the expected improvement of a Gaussian random variable
    with mean MU and standard deviation SIGMA, above the threshold Z.

 CALL: EI = stk_distrib_normal_ei (Z, MU, SIGMA, MINIMIZE)

    computes the expected improvement of a Gaussian random variable
    with mean MU and standard deviation SIGMA, below the threshold Z
    if MINIMIZE is true, above the threshold Z otherwise.

 NOTE

    Starting with STK 2.4.1, it is recommended to use stk_sampcrit_ei_eval
    instead of this function.  Be careful, however, with the "direction" of
    the improvement that you want to compute:

       EI = stk_sampcrit_ei_eval (MU, SIGMA, Z)

    computes the expected improvement *below* the threshold Z, and is thus
    equivalent to

       EI = stk_distrib_normal_ei (Z, MU, SIGMA, true)

    To compute the expected improvement *above* Z, change signs as follows:

       EI = stk_sampcrit_ei_eval (-MU, SIGMA, -Z)

 REFERENCES

   [1] D. R. Jones, M. Schonlau and William J. Welch. Efficient global
       optimization of expensive black-box functions.  Journal of Global
       Optimization, 13(4):455-492, 1998.

   [2] J. Mockus, V. Tiesis and A. Zilinskas. The application of Bayesian
       methods for seeking the extremum. In L.C.W. Dixon and G.P. Szego,
       editors, Towards Global Optimization, volume 2, pages 117-129, North
       Holland, New York, 1978.

 See also stk_sampcrit_ei_eval, stk_distrib_student_ei