School of Economics and Management
Beihang University
http://yanfei.site
In Case 1 a new simplex is formed with \({\mathbf x_{n+1}}\) replaced by the reflected point \({\mathbf x_{r}}\). Then go back to step 1.
In Case 2, \({\mathbf x_r}<{\mathbf x_1}\). A good direction has been found so we expand along that direction \[ {\mathbf x_e}={\mathbf x_0}+\gamma({\mathbf x_r}-{\mathbf x_0}).\]
A common choice is \(\gamma=2\)
Case 3 implies that there may be a valley between \({\mathbf x_{n+1}}\) and \({\mathbf x_{r}}\) so find the contracted point. A new simplex is formed with the contraction point if it is better than \({\mathbf x_{n+1}}\) \[{\mathbf x_c}={\mathbf x_0}+\rho({\mathbf x_{n+1}}-{\mathbf x_0})\]
A common choice is \(\rho=0.5\)
If \(f({\mathbf x_{n+1}})\leq f({\mathbf x_{c}})\) then contracting away from the worst point does not lead to a better point. In this case the function is too irregular a smaller simplex should be used. Shrink the simplex \[{\mathbf x_i}={\mathbf x_1}+\sigma({\mathbf x_i}-{\mathbf x_1})\]
A popular choice is \(\sigma=0.5\).
Build the matrix \(\tilde{X}=\left({\mathbf x_1}-{\mathbf x_{n+1}},{\mathbf x_2-{\mathbf x_{n+1}}},\ldots, {\mathbf x_{n}-{\mathbf x_{n+1}}}\right)\)
The volume of the simplex is \(\frac{1}{2}|det(\tilde{X})|\)
Some of you may have learnt the formula for the area of a triangle as:\[\frac{1}{2}\left|det\left( \begin{array}{ccc} {\mathbf x_1}& {\mathbf x_2}& {\mathbf x_3}\\ 1 & 1 & 1 \end{array} \right)\right|\] The two approaches are equivalent.
optim()
optim()
control=list(trace, REPORT=1)
will print out details about each step of the algorithm.Some important lessons: